public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: sudeep.holla@arm.com
Cc: linux-acpi@vger.kernel.org
Subject: [bug report] mailbox: pcc: Move bulk of PCCT parsing into pcc_mbox_probe
Date: Mon, 29 Nov 2021 11:38:32 +0300	[thread overview]
Message-ID: <20211129083832.GA31721@kili> (raw)

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

                 reply	other threads:[~2021-11-29  8:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211129083832.GA31721@kili \
    --to=dan.carpenter@oracle.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=sudeep.holla@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox