From: Jiri Engelthaler Date: Thu, 20 Sep 2012 14:49:50 +0000 (+0200) Subject: mtd: slram: invalid checking of absolute end address X-Git-Tag: firefly_0821_release~7541^2~279 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=38f6449bb781860f9a6b62102e5aea75fe4e7945;p=firefly-linux-kernel-4.4.55.git mtd: slram: invalid checking of absolute end address commit c36a7ff4578ab6294885aef5ef241aeec4cdb1f0 upstream. Fixed parsing end absolute address. Signed-off-by: Jiri Engelthaler Signed-off-by: Artem Bityutskiy Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/mtd/devices/slram.c b/drivers/mtd/devices/slram.c index e585263161b9..f38c348e00b7 100644 --- a/drivers/mtd/devices/slram.c +++ b/drivers/mtd/devices/slram.c @@ -266,7 +266,7 @@ static int parse_cmdline(char *devname, char *szstart, char *szlength) if (*(szlength) != '+') { devlength = simple_strtoul(szlength, &buffer, 0); - devlength = handle_unit(devlength, buffer) - devstart; + devlength = handle_unit(devlength, buffer); if (devlength < devstart) goto err_out;