All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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 16:50:16 +0000	[thread overview]
Message-ID: <20120919165016.GA11290@kroah.com> (raw)
In-Reply-To: <20120919151828.GA28886@localhost>

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 :)

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

  reply	other threads:[~2012-09-19 16:50 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 [this message]
2012-09-19 17:10 ` Julia Lawall
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=20120919165016.GA11290@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --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 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.