mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Brian Norris <computersforpeace@gmail.com>
To: Caizhiyong <caizhiyong@hisilicon.com>
Cc: Huang Shijie <b32955@freescale.com>,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	"Wanglin (Albert)" <albert.wanglin@hisilicon.com>,
	David Woodhouse <David.Woodhouse@intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Artem Bityutskiy <artem.bityutskiy@linux.intel.com>,
	Quyaxin <quyaxin@hisilicon.com>
Subject: Re: [PATCH] mtd: nand:  assign mtd->name in find_full_id_nand
Date: Sun, 12 Jan 2014 23:46:13 -0800	[thread overview]
Message-ID: <20140113074613.GI1992@norris-Latitude-E6410> (raw)
In-Reply-To: <C3050A4DBA34F345975765E43127F10F25E48C13@SZXEMA512-MBX.china.huawei.com>

On Mon, Jan 13, 2014 at 04:12:45AM +0000, Caizhiyong wrote:
> > -----Original Message-----
> > From: Brian Norris [mailto:computersforpeace@gmail.com]
> > Sent: Sunday, January 12, 2014 4:10 AM
> > 
> > On Thu, Dec 26, 2013 at 10:19:39AM +0800, Huang Shijie wrote:
> > > On Thu, Dec 26, 2013 at 01:51:58AM +0000, Caizhiyong wrote:
> > > > From: Cai Zhiyong <caizhiyong@huawei.com>
> > > > Date: Wed, 25 Dec 2013 21:19:21 +0800
> > > > Subject: [PATCH] mtd: nand: assign mtd->name in find_full_id_nand
> > > >
> > > > This patch assigned the type->name to mtd->name when mtd->name is
> > > > NULL in function "find_full_id_nand".
> > > > mtd->name is NULL may cause some problem.
> > > >
> > > > Signed-off-by: Cai Zhiyong <caizhiyong@huawei.com>
> > > Acked-by: Huang Shijie <b32955@freescale.com>
> > 
> > Thanks, the patch looks good. Pushed to l2-mtd.git.
> > 
> > Wouldn't this trigger an exception when reading
> > /sys/class/mtd/mtdX/name? If so, should this be marked for stable?
> 
> View the source code, if mtd->name is NULL, cat "/sys/class/mtd/mtdX/name" will get string "(null)".
> 
> static ssize_t mtd_name_show(struct device *dev, struct device_attribute *attr, char *buf)
> {
> 	struct mtd_info *mtd = dev_get_drvdata(dev);
> 
> 	return snprintf(buf, PAGE_SIZE, "%s\n", mtd->name);
> }

Thanks, I forgot that the kernel's printf-like functions handle NULL
pointers gracefully. In that case, this probably doesn't need to be in
-stable.

Brian

      reply	other threads:[~2014-01-13  7:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-26  1:51 Caizhiyong
2013-12-26  2:19 ` Huang Shijie
2014-01-11 20:10   ` Brian Norris
2014-01-13  4:12     ` Caizhiyong
2014-01-13  7:46       ` Brian Norris [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=20140113074613.GI1992@norris-Latitude-E6410 \
    --to=computersforpeace@gmail.com \
    --cc=David.Woodhouse@intel.com \
    --cc=albert.wanglin@hisilicon.com \
    --cc=artem.bityutskiy@linux.intel.com \
    --cc=b32955@freescale.com \
    --cc=caizhiyong@hisilicon.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=quyaxin@hisilicon.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

all inboxes | Powered by JetHome®