projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5bded4e
)
drbd: fix memory leak in drbd_adm_resize
author
Oleg Drokin
<
[email protected]
>
Sun, 26 Apr 2015 05:28:43 +0000
(
01:28
-0400)
committer
Jens Axboe
<
[email protected]
>
Wed, 25 Nov 2015 16:22:03 +0000
(09:22 -0700)
new_disk_conf could be leaked if the follow on checks fail,
so make sure to free it on error if it was not assigned yet.
Found with smatch.
Signed-off-by: Oleg Drokin <
[email protected]
>
Signed-off-by: Philipp Reisner <
[email protected]
>
Signed-off-by: Lars Ellenberg <
[email protected]
>
Signed-off-by: Jens Axboe <
[email protected]
>
drivers/block/drbd/drbd_nl.c
patch
|
blob
|
history
diff --git
a/drivers/block/drbd/drbd_nl.c
b/drivers/block/drbd/drbd_nl.c
index ee34739ee9ffe365efd5b8711b7dde91fb61c00b..613778994b2394bd4c9739bfbf2bb07817ff770c 100644
(file)
--- a/
drivers/block/drbd/drbd_nl.c
+++ b/
drivers/block/drbd/drbd_nl.c
@@
-2706,6
+2706,7
@@
int drbd_adm_resize(struct sk_buff *skb, struct genl_info *info)
mutex_unlock(&device->resource->conf_update);
synchronize_rcu();
kfree(old_disk_conf);
+ new_disk_conf = NULL;
}
ddsf = (rs.resize_force ? DDSF_FORCED : 0) | (rs.no_resync ? DDSF_NO_RESYNC : 0);
@@
-2739,6
+2740,7
@@
int drbd_adm_resize(struct sk_buff *skb, struct genl_info *info)
fail_ldev:
put_ldev(device);
+ kfree(new_disk_conf);
goto fail;
}