]> git.baikalelectronics.ru Git - kernel.git/commit
nvmet: fixup crash on NULL device path
authorHannes Reinecke <hare@suse.de>
Wed, 25 Jul 2018 06:35:17 +0000 (08:35 +0200)
committerChristoph Hellwig <hch@lst.de>
Wed, 25 Jul 2018 11:14:03 +0000 (13:14 +0200)
commit8aa5e451652a6953398bcc033ce25466fe7f32d7
tree30c1c8e56e16dfc432d947e6615626275b22d7cc
parente24bdf179c05599121b60b02dde3b21bdd9ac07d
nvmet: fixup crash on NULL device path

When writing an empty string into the device_path attribute the kernel
will crash with

nvmet: failed to open block device (null): (-22)
BUG: unable to handle kernel NULL pointer dereference at 0000000000000000

This patch sanitizes the error handling for invalid device path settings.

Fixes: 7ffa682f ("nvmet: add a generic NVMe target")
Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/configfs.c