]> 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)
commitbd855e368e2a41a8910fd46a4a17d1465c09d08b
tree30c1c8e56e16dfc432d947e6615626275b22d7cc
parentb23c9739d7cfb0563c8f4d9607aa1fca15b1d53e
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: ffb9618a ("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