From: Julia Lawall <julia.lawall@lip6.fr>
To: kernel-janitors@vger.kernel.org
Subject: Re: [staging:staging-next 67/134] drivers/staging/rts_pstor/rtsx.c:397:16-19: ERROR: dev is NULL but
Date: Wed, 19 Sep 2012 17:10:35 +0000 [thread overview]
Message-ID: <alpine.DEB.2.02.1209191910060.2758@hadrien> (raw)
In-Reply-To: <20120919151828.GA28886@localhost>
On Wed, 19 Sep 2012, Greg Kroah-Hartman wrote:
> On Wed, Sep 19, 2012 at 11:18:28PM +0800, Fengguang Wu wrote:
> > Hi Toshiaki,
> >
> > FYI, there are new coccinelle warnings show up in
> >
> > tree: git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git staging-next
> > head: 95bc359f98a077a5cfc34feb0a333d11a4124b1c
> > commit: d084610bb1e825eb60a1ca81a801aedfd36ff332 [67/134] staging/rts_pstor: Use pr_ or dev_ printks in rtsx.c
> >
> > All coccinelle warnings:
> >
> > + drivers/staging/rts_pstor/rtsx.c:397:16-19: ERROR: dev is NULL but dereferenced.
> > drivers/staging/rts_pstor/rtsx.c:447:16-19: ERROR: dev is NULL but dereferenced.
> > drivers/staging/rts_pstor/rtsx.c:358:16-19: ERROR: dev is NULL but dereferenced.
> >
> > vim +397 drivers/staging/rts_pstor/rtsx.c
> > 387 }
> > 388
> > 389 static int rtsx_resume(struct pci_dev *pci)
> > 390 {
> > 391 struct rtsx_dev *dev = (struct rtsx_dev *)pci_get_drvdata(pci);
> > 392 struct rtsx_chip *chip;
> > 393
> > 394 dev_info(&dev->pci->dev, "Ready to resume\n");
> > 395
> > 396 if (!dev) {
> > > 397 dev_err(&dev->pci->dev, "Invalid memory\n");
> > 398 return 0;
> > 399 }
>
> What about the dev_info() check? Shouldn't that also trigger the same
> coccinelle warning? It looks just as wrong :)
The rule only looks under null-testing ifs.
julia
> Both of these lines (dev_info() and dev_err()), should just be removed
> entirely, solving this problem, and making the syslog less noisy.
>
> Toshiaki, care to make up a patch fixing this up?
>
> thanks,
>
> greg k-h
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2012-09-19 17:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-19 15:18 [staging:staging-next 67/134] drivers/staging/rts_pstor/rtsx.c:397:16-19: ERROR: dev is NULL but Fengguang Wu
2012-09-19 16:50 ` Greg Kroah-Hartman
2012-09-19 17:10 ` Julia Lawall [this message]
2012-09-19 23:36 ` Toshiaki Yamane
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=alpine.DEB.2.02.1209191910060.2758@hadrien \
--to=julia.lawall@lip6.fr \
--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