Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mailbox: pcc: Avoid using the uninitialized variable 'dev'

Smatch static checker warns:

| drivers/mailbox/pcc.c:292 pcc_mbox_request_channel()
| error: uninitialized symbol 'dev'.

Fix the same by using pr_err instead of dev_err as the variable 'dev'
is uninitialized at that stage.

Fixes: ce028702ddbc ("mailbox: pcc: Move bulk of PCCT parsing into pcc_mbox_probe")
Cc: Jassi Brar <jassisinghbrar@gmail.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>

authored by

Sudeep Holla and committed by
Jassi Brar
960c4056 af8d0f6d

+1 -1
+1 -1
drivers/mailbox/pcc.c
··· 289 289 pchan = chan_info + subspace_id; 290 290 chan = pchan->chan.mchan; 291 291 if (IS_ERR(chan) || chan->cl) { 292 - dev_err(dev, "Channel not found for idx: %d\n", subspace_id); 292 + pr_err("Channel not found for idx: %d\n", subspace_id); 293 293 return ERR_PTR(-EBUSY); 294 294 } 295 295 dev = chan->mbox->dev;