projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3d9a9e9
)
md/md-linear: Fix a NULL vs IS_ERR() bug in linear_add()
author
Dan Carpenter
<dan.carpenter@linaro.org>
Wed, 15 Jan 2025 06:53:52 +0000
(09:53 +0300)
committer
Song Liu
<song@kernel.org>
Thu, 16 Jan 2025 17:31:25 +0000
(09:31 -0800)
The linear_conf() returns error pointers, it doesn't return NULL. Update
the error checking to match.
Fixes:
127186cfb184
("md: reintroduce md-linear")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Yu Kuai <yukuai3@huawei.com>
Link:
https://lore.kernel.org/r/add654be-759f-4b2d-93ba-a3726dae380c@stanley.mountain
Signed-off-by: Song Liu <song@kernel.org>
drivers/md/md-linear.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/md/md-linear.c
b/drivers/md/md-linear.c
index 53bc3fda9edb2cde4121133cb7fa57f7e06feed9..a382929ce7bab43d953efa3babc0df7f19e8d2cd 100644
(file)
--- a/
drivers/md/md-linear.c
+++ b/
drivers/md/md-linear.c
@@
-204,8
+204,8
@@
static int linear_add(struct mddev *mddev, struct md_rdev *rdev)
rdev->saved_raid_disk = -1;
newconf = linear_conf(mddev, mddev->raid_disks + 1);
- if (
!newconf
)
- return
-ENOMEM
;
+ if (
IS_ERR(newconf)
)
+ return
PTR_ERR(newconf)
;
/* newconf->raid_disks already keeps a copy of * the increased
* value of mddev->raid_disks, WARN_ONCE() is just used to make