mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 19:29:37 +00:00
remoteproc/mediatek: fix null pointer dereference on null scp pointer
Currently when pointer scp is null a dev_err is being called that
references the pointer which is the very thing we are trying to
avoid doing. Remove the extraneous error message to avoid this
issue.
Addresses-Coverity: ("Dereference after null check")
Fixes: 63c13d61ea
("remoteproc/mediatek: add SCP support for mt8183")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20200918152428.27258-1-colin.king@canonical.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This commit is contained in:
parent
cb2d8d5b19
commit
434ac4d514
1 changed files with 1 additions and 3 deletions
|
@ -30,10 +30,8 @@ int scp_ipi_register(struct mtk_scp *scp,
|
|||
scp_ipi_handler_t handler,
|
||||
void *priv)
|
||||
{
|
||||
if (!scp) {
|
||||
dev_err(scp->dev, "scp device is not ready\n");
|
||||
if (!scp)
|
||||
return -EPROBE_DEFER;
|
||||
}
|
||||
|
||||
if (WARN_ON(id >= SCP_IPI_MAX) || WARN_ON(handler == NULL))
|
||||
return -EINVAL;
|
||||
|
|
Loading…
Reference in a new issue