summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-table.c
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-12-31 13:59:55 +0100
committerMark Brown <broonie@linaro.org>2013-12-31 13:59:55 +0100
commit68066bb378a0504439e046cdb55d88362eb6379d (patch)
tree0b60f72ddf7108a63dd4db617b42e07fbae5346d /drivers/md/dm-table.c
parentspi: dw: fix memory leak on error path (diff)
parentLinux 3.13-rc6 (diff)
downloadlinux-68066bb378a0504439e046cdb55d88362eb6379d.tar.xz
linux-68066bb378a0504439e046cdb55d88362eb6379d.zip
Merge tag 'v3.13-rc6' into spi-dw
To resolve trivial overlaps with fixes. Linux 3.13-rc6
Diffstat (limited to 'drivers/md/dm-table.c')
-rw-r--r--drivers/md/dm-table.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 465f08ca62b1..3ba6a3859ce3 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -200,6 +200,11 @@ int dm_table_create(struct dm_table **result, fmode_t mode,
num_targets = dm_round_up(num_targets, KEYS_PER_NODE);
+ if (!num_targets) {
+ kfree(t);
+ return -ENOMEM;
+ }
+
if (alloc_targets(t, num_targets)) {
kfree(t);
return -ENOMEM;