projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bcd535f
)
block: sunvdc: add check for mdesc_grab() returning NULL
author
Liang He
<windhl@126.com>
Wed, 15 Mar 2023 06:20:32 +0000
(14:20 +0800)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Wed, 22 Mar 2023 12:33:47 +0000
(13:33 +0100)
[ Upstream commit
6030363199e3a6341afb467ddddbed56640cbf6a
]
In vdc_port_probe(), we should check the return value of mdesc_grab() as
it may return NULL, which can cause potential NPD bug.
Fixes: 43fdf27470b2 ("[SPARC64]: Abstract out mdesc accesses for better MD update handling.")
Signed-off-by: Liang He <windhl@126.com>
Link:
https://lore.kernel.org/r/20230315062032.1741692-1-windhl@126.com
[axboe: style cleanup]
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/block/sunvdc.c
patch
|
blob
|
history
diff --git
a/drivers/block/sunvdc.c
b/drivers/block/sunvdc.c
index fb855da971ee7b388efd1f385fe6c929bda97d4f..9fa821fa76b07b47d673f7d57c591fc8e5ddd4a9 100644
(file)
--- a/
drivers/block/sunvdc.c
+++ b/
drivers/block/sunvdc.c
@@
-972,6
+972,8
@@
static int vdc_port_probe(struct vio_dev *vdev, const struct vio_device_id *id)
print_version();
hp = mdesc_grab();
+ if (!hp)
+ return -ENODEV;
err = -ENODEV;
if ((vdev->dev_no << PARTITION_SHIFT) & ~(u64)MINORMASK) {