summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGen Zhang <blackgod016574@gmail.com>2019-05-29 09:33:20 +0800
committerMike Snitzer <snitzer@redhat.com>2019-06-25 13:34:52 -0400
commitdec7e6494e1aea6bf676223da3429cd17ce0af79 (patch)
tree85c491669fffdaf982b54457b9bec99cfc0dc496
parent9e0babf2c06c73cda2c0cd37a1653d823adb40ec (diff)
downloadlwn-dec7e6494e1aea6bf676223da3429cd17ce0af79.tar.gz
lwn-dec7e6494e1aea6bf676223da3429cd17ce0af79.zip
dm init: fix incorrect uses of kstrndup()
Fix 2 kstrndup() calls with incorrect argument order. Fixes: 6bbc923dfcf5 ("dm: add support to directly boot to a mapped device") Cc: stable@vger.kernel.org # v5.1 Signed-off-by: Gen Zhang <blackgod016574@gmail.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
-rw-r--r--drivers/md/dm-init.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/md/dm-init.c b/drivers/md/dm-init.c
index 352e803f566e..64611633e77c 100644
--- a/drivers/md/dm-init.c
+++ b/drivers/md/dm-init.c
@@ -140,8 +140,8 @@ static char __init *dm_parse_table_entry(struct dm_device *dev, char *str)
return ERR_PTR(-EINVAL);
}
/* target_args */
- dev->target_args_array[n] = kstrndup(field[3], GFP_KERNEL,
- DM_MAX_STR_SIZE);
+ dev->target_args_array[n] = kstrndup(field[3], DM_MAX_STR_SIZE,
+ GFP_KERNEL);
if (!dev->target_args_array[n])
return ERR_PTR(-ENOMEM);
@@ -275,7 +275,7 @@ static int __init dm_init_init(void)
DMERR("Argument is too big. Limit is %d\n", DM_MAX_STR_SIZE);
return -EINVAL;
}
- str = kstrndup(create, GFP_KERNEL, DM_MAX_STR_SIZE);
+ str = kstrndup(create, DM_MAX_STR_SIZE, GFP_KERNEL);
if (!str)
return -ENOMEM;