All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] mailbox: pcc: Move bulk of PCCT parsing into pcc_mbox_probe
@ 2021-11-29  8:38 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2021-11-29  8:38 UTC (permalink / raw)
  To: sudeep.holla; +Cc: linux-acpi

Hello Sudeep Holla,

The patch ce028702ddbc: "mailbox: pcc: Move bulk of PCCT parsing into
pcc_mbox_probe" from Sep 17, 2021, leads to the following Smatch
static checker warning:

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

drivers/mailbox/pcc.c
    282         struct mbox_chan *chan;
    283         struct device *dev;
    284         unsigned long flags;
    285 
    286         if (subspace_id < 0 || subspace_id >= pcc_chan_count)
    287                 return ERR_PTR(-ENOENT);
    288 
    289         pchan = chan_info + subspace_id;
    290         chan = pchan->chan.mchan;
    291         if (IS_ERR(chan) || chan->cl) {
--> 292                 dev_err(dev, "Channel not found for idx: %d\n", subspace_id);
                                ^^^
"dev" is uninitialized.

    293                 return ERR_PTR(-EBUSY);
    294         }
    295         dev = chan->mbox->dev;
                ^^^^^^^^^^^^^^^^^^^^^^
Set here.

    296 
    297         spin_lock_irqsave(&chan->lock, flags);
    298         chan->msg_free = 0;
    299         chan->msg_count = 0;
    300         chan->active_req = NULL;
    301         chan->cl = cl;
    302         init_completion(&chan->tx_complete);
    303 
    304         if (chan->txdone_method == TXDONE_BY_POLL && cl->knows_txdone)
    305                 chan->txdone_method = TXDONE_BY_ACK;
    306 
    307         spin_unlock_irqrestore(&chan->lock, flags);
    308 
    309         if (pchan->plat_irq > 0) {
    310                 int rc;
    311 
    312                 rc = devm_request_irq(dev, pchan->plat_irq, pcc_mbox_irq, 0,
    313                                       MBOX_IRQ_NAME, chan);
    314                 if (unlikely(rc)) {
    315                         dev_err(dev, "failed to register PCC interrupt %d\n",
    316                                 pchan->plat_irq);
    317                         pcc_mbox_free_channel(&pchan->chan);
    318                         return ERR_PTR(rc);
    319                 }
    320         }
    321 
    322         return &pchan->chan;
    323 }

regards,
dan carpenter

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-29  8:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-29  8:38 [bug report] mailbox: pcc: Move bulk of PCCT parsing into pcc_mbox_probe Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.