mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
md/raid0: fix uninitialized variable bug
If this function fails the callers expect that *private_conf is set to an ERR_PTR() but that isn't true for the first error path where we can't allocate "conf". It leads to some uninitialized variable bugs. Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Shaohua Li <[email protected]>
This commit is contained in:
parent
5b5b7fd185
commit
7dedd15dd2
1 changed files with 1 additions and 0 deletions
|
|
@ -85,6 +85,7 @@ static int create_strip_zones(struct mddev *mddev, struct r0conf **private_conf)
|
|||
struct r0conf *conf = kzalloc(sizeof(*conf), GFP_KERNEL);
|
||||
unsigned short blksize = 512;
|
||||
|
||||
*private_conf = ERR_PTR(-ENOMEM);
|
||||
if (!conf)
|
||||
return -ENOMEM;
|
||||
rdev_for_each(rdev1, mddev) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue