On 09/23/2013 10:56 PM, Jeff Moyer wrote:I checked most of the callers of this function in current code tree.Vaughan Cao<vaughan.cao@xxxxxxxxxx> writes:Thanks for your comment, Jeff. I have the same feeling as you, however,
register_blkdev(0, NULL) can result kernel Oops by copying from NULLUhh, so yeah, this is an exported function, so I could see maybe wanting
in strlcpy(). Fix it by checking NULL pointer at the beginning and
WARN when encountered in unregister_blkdev.
to do the argument checking. But honestly, if your driver can't even
get this right, is there any hope of it actually working?
This seems like a pointless patch to me, but ultimately it's up to Jens.
Cheers,
Jeff
p.s. the kerneldoc tells you what to put there:
* @name: the name of the new block device as a zero terminated string
shouldn't kernel do its best to provide the maximum stable working ability?
And it's test case 7 of block driver in ltp project -
http://sourceforge.net/p/ltp/git/ci/master/tree/testcases/kernel/device-drivers/block/kernel_space/test_block.c.
It seems their attitude is we should check this.
Vaughan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/