diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2016-04-14 11:31:49 +0200 |
---|---|---|
committer | Shaohua Li <shli@fb.com> | 2016-04-14 18:57:59 +0200 |
commit | 7dedd15dd2527055390b9742c87a02556d3180f4 (patch) | |
tree | 18d258bfbee4dfb7f2240eecf186843acf613535 /drivers | |
parent | Merge branch 'parisc-4.6-3' of git://git.kernel.org/pub/scm/linux/kernel/git/... (diff) | |
download | linux-7dedd15dd2527055390b9742c87a02556d3180f4.tar.xz linux-7dedd15dd2527055390b9742c87a02556d3180f4.zip |
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 <dan.carpenter@oracle.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/raid0.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c index 2ea12c6bf659..f63dbb68e3a9 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c @@ -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) { |