All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boaz Harrosh <bharrosh@panasas.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: "Nicholas A. Bellinger" <nab@linux-iscsi.org>,
	linux-scsi <linux-scsi@vger.kernel.org>,
	Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH] tcm: Convert backstore ->set_configfs_dev_params() to use parser.h
Date: Tue, 09 Nov 2010 19:58:01 +0200	[thread overview]
Message-ID: <4CD98BA9.7010102@panasas.com> (raw)
In-Reply-To: <20101109134522.GA4548@infradead.org>

On 11/09/2010 03:45 PM, Christoph Hellwig wrote:
> On Tue, Nov 09, 2010 at 02:03:21AM -0800, Nicholas A. Bellinger wrote:
>> <nod> thanks for the pointer here..
>>
>> Btw, the kstrdup() is required because the configfs attribute store
>> function will be passing a 'const char *page' that is propigated from
>> target_core_configfs.c: target_core_store_dev_control() out to
>> ->set_configfs_dev_params() backend code.
> 
> strsep doesn't modify the data it points to, just the pointer itself.
> We could get around this by casting the pointer, which at least avoids
> the memory allocation.  But it's probably not worth bothering.
> 

If it is so, then the proper fix is to "const" the parameter to strsep()
most certainly don't hide a const_cast like that. This is a landmine
waiting to explode.

Boaz

      reply	other threads:[~2010-11-09 17:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-09  9:48 [PATCH] tcm: Convert backstore ->set_configfs_dev_params() to use parser.h Nicholas A. Bellinger
2010-11-09 10:03 ` Christoph Hellwig
2010-11-09 10:03   ` Nicholas A. Bellinger
2010-11-09 13:45     ` Christoph Hellwig
2010-11-09 17:58       ` Boaz Harrosh [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=4CD98BA9.7010102@panasas.com \
    --to=bharrosh@panasas.com \
    --cc=hch@infradead.org \
    --cc=hch@lst.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=nab@linux-iscsi.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.