s390/ccwgroup: increase string buffer size
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Thu, 4 May 2017 11:35:33 +0000 (13:35 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Tue, 9 May 2017 08:44:36 +0000 (10:44 +0200)
Avoid false positive warnings like this with gcc 7.1:

drivers/s390/cio/ccwgroup.c:41:21:
 warning: '%d' directive writing between 1 and 10 bytes into a region of size 4
   sprintf(str, "cdev%d", i);

and simply increase the size of the string buffer.

Reviewed-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/cio/ccwgroup.c

index e443b0d..34b9ad6 100644 (file)
@@ -35,7 +35,7 @@ static struct bus_type ccwgroup_bus_type;
 static void __ccwgroup_remove_symlinks(struct ccwgroup_device *gdev)
 {
        int i;
-       char str[8];
+       char str[16];
 
        for (i = 0; i < gdev->count; i++) {
                sprintf(str, "cdev%d", i);
@@ -238,7 +238,7 @@ static void ccwgroup_release(struct device *dev)
 
 static int __ccwgroup_create_symlinks(struct ccwgroup_device *gdev)
 {
-       char str[8];
+       char str[16];
        int i, rc;
 
        for (i = 0; i < gdev->count; i++) {