diff options
Diffstat (limited to 'drivers/md/dm-table.c')
-rw-r--r-- | drivers/md/dm-table.c | 5 |
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, | |||
200 | 200 | ||
201 | num_targets = dm_round_up(num_targets, KEYS_PER_NODE); | 201 | num_targets = dm_round_up(num_targets, KEYS_PER_NODE); |
202 | 202 | ||
203 | if (!num_targets) { | ||
204 | kfree(t); | ||
205 | return -ENOMEM; | ||
206 | } | ||
207 | |||
203 | if (alloc_targets(t, num_targets)) { | 208 | if (alloc_targets(t, num_targets)) { |
204 | kfree(t); | 209 | kfree(t); |
205 | return -ENOMEM; | 210 | return -ENOMEM; |