From: Al Viro Date: Sun, 22 Jul 2007 16:01:20 +0000 (+0200) Subject: ieee1394: forgotten dereference... X-Git-Tag: v2.6.16.53-rc1~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e4c0eaae96b9a10dbde07acde81a1b488e1062e;p=thirdparty%2Fkernel%2Fstable.git ieee1394: forgotten dereference... Going through the string and waiting for _pointer_ to become '\0' is not what the authors meant... Signed-off-by: Al Viro Acked-by: Ben Collins Signed-off-by: Adrian Bunk --- diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c index 082c7fd239f58..8805a27b63e6c 100644 --- a/drivers/ieee1394/nodemgr.c +++ b/drivers/ieee1394/nodemgr.c @@ -240,7 +240,7 @@ static ssize_t fw_show_##class##_##td_kv (struct device *dev, struct device_attr memcpy(buf, \ CSR1212_TEXTUAL_DESCRIPTOR_LEAF_DATA(class->td_kv), \ len); \ - while ((buf + len - 1) == '\0') \ + while (buf[len - 1] == '\0') \ len--; \ buf[len++] = '\n'; \ buf[len] = '\0'; \