public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: re: mailbox: Add Broadcom PDC mailbox driver
Date: Wed, 03 Aug 2016 10:58:11 +0000	[thread overview]
Message-ID: <20160803105811.GA25875@mwanda> (raw)

Hello Rob Rice,

This is a semi-automatic email about new static checker warnings.

The patch a24532f8d17b: "mailbox: Add Broadcom PDC mailbox driver" 
from Jun 30, 2016, leads to the following Smatch complaint:

drivers/mailbox/bcm-pdc-mailbox.c:929 pdc_irq_handler()
	 warn: variable dereferenced before check 'pdcs' (see line 918)

drivers/mailbox/bcm-pdc-mailbox.c
   917		struct pdc_state *pdcs = cookie;
   918		u32 intstatus = ioread32(pdcs->pdc_reg_vbase + PDC_INTSTATUS_OFFSET);
                                         ^^^^^^^^^^^^^^^^^^^
Dereference.

   919	
   920		if (intstatus & PDC_XMTINTEN_0)
   921			set_bit(PDC_XMTINT_0, &pdcs->intstatus);
   922		if (intstatus & PDC_RCVINTEN_0)
   923			set_bit(PDC_RCVINT_0, &pdcs->intstatus);
   924	
   925		/* Clear interrupt flags in device */
   926		iowrite32(intstatus, pdcs->pdc_reg_vbase + PDC_INTSTATUS_OFFSET);
   927	
   928		/* Wakeup IRQ thread */
   929		if (pdcs && (irq = pdcs->pdc_irq) && (intstatus & PDC_INTMASK))
                    ^^^^
Check too late to do any good.  Delete?

   930			return IRQ_WAKE_THREAD;
   931	

regards,
dan carpenter

                 reply	other threads:[~2016-08-03 10:58 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=20160803105811.GA25875@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    /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