From: Al Viro Date: Sun, 15 Jul 2007 19:59:51 +0000 (+0100) Subject: ieee1394: forgotten dereference... X-Git-Tag: firefly_0821_release~28264 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=51ec138c6416e9ed2ba0eae3af5f0ea8a90ae44b;p=firefly-linux-kernel-4.4.55.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: Linus Torvalds --- diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c index c4d3d4131f01..51a12062ed36 100644 --- a/drivers/ieee1394/nodemgr.c +++ b/drivers/ieee1394/nodemgr.c @@ -283,7 +283,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'; \