linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Vasiliy Kulikov <segooon@gmail.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>,
	Greg Kroah-Hartman <gregkh@suse.de>,
	kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
	linuxppc-dev@ozlabs.org, linux-usb@vger.kernel.org,
	Anton Vorontsov <avorontsov@ru.mvista.com>,
	Dinh Nguyen <Dinh.Nguyen@freescale.com>
Subject: Re: [PATCH 2/7] usb: fsl_udc_core: check return value of create_proc_read_entry()
Date: Sun, 1 Aug 2010 12:49:41 +0200	[thread overview]
Message-ID: <20100801104941.GI26313@bicker> (raw)
In-Reply-To: <20100801061934.GB2650@albatros>

On Sun, Aug 01, 2010 at 10:19:34AM +0400, Vasiliy Kulikov wrote:
> On Sat, Jul 31, 2010 at 21:17 +0200, Dan Carpenter wrote:
> > On Sat, Jul 31, 2010 at 09:38:20PM +0400, Kulikov Vasiliy wrote:
> > > create_proc_read_entry() may fail, if so return -ENOMEM.
> > > 
> > 
> > It can fail, but also we return NULL if procfs is disabled.  I haven't
> > looked at it very carefully, would this patch break the module if procfs
> > was disabled?
> Probably you are right, but many drivers in tree compare return value
> with NULL. Some of them interpret this as error, some of them simply
> call pr_warn("Hmm, I cannot create file in proc, strange..."). Maybe
> there is more simplier way to check it without #ifdefs?
> 

If the allocation fails, there is already a warning so no need to add
another.

These things are one time allocation, normally near boot up when memory
is plentifull.  The places that do check should be audited to make sure
there isn't an unneeded dependency on PROC_FS.  I would just leave the
rest.

regards,
dan carpenter

      reply	other threads:[~2010-08-01 10:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-31 17:38 [PATCH 2/7] usb: fsl_udc_core: check return value of create_proc_read_entry() Kulikov Vasiliy
2010-07-31 19:17 ` Dan Carpenter
2010-08-01  6:19   ` Vasiliy Kulikov
2010-08-01 10:49     ` Dan Carpenter [this message]

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=20100801104941.GI26313@bicker \
    --to=error27@gmail.com \
    --cc=Dinh.Nguyen@freescale.com \
    --cc=avorontsov@ru.mvista.com \
    --cc=dbrownell@users.sourceforge.net \
    --cc=gregkh@suse.de \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=segooon@gmail.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;
as well as URLs for NNTP newsgroup(s).