diff options
Diffstat (limited to 'drivers/md/dm-ioctl.c')
-rw-r--r-- | drivers/md/dm-ioctl.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c index 1ce84ed0b765..a1a3e6df17b8 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c | |||
@@ -880,6 +880,7 @@ static int dev_set_geometry(struct dm_ioctl *param, size_t param_size) | |||
880 | struct hd_geometry geometry; | 880 | struct hd_geometry geometry; |
881 | unsigned long indata[4]; | 881 | unsigned long indata[4]; |
882 | char *geostr = (char *) param + param->data_start; | 882 | char *geostr = (char *) param + param->data_start; |
883 | char dummy; | ||
883 | 884 | ||
884 | md = find_device(param); | 885 | md = find_device(param); |
885 | if (!md) | 886 | if (!md) |
@@ -891,8 +892,8 @@ static int dev_set_geometry(struct dm_ioctl *param, size_t param_size) | |||
891 | goto out; | 892 | goto out; |
892 | } | 893 | } |
893 | 894 | ||
894 | x = sscanf(geostr, "%lu %lu %lu %lu", indata, | 895 | x = sscanf(geostr, "%lu %lu %lu %lu%c", indata, |
895 | indata + 1, indata + 2, indata + 3); | 896 | indata + 1, indata + 2, indata + 3, &dummy); |
896 | 897 | ||
897 | if (x != 4) { | 898 | if (x != 4) { |
898 | DMWARN("Unable to interpret geometry settings."); | 899 | DMWARN("Unable to interpret geometry settings."); |