staging: comedi: comedi_bond: no need to initialize file[]
authorIan Abbott <abbotti@mev.co.uk>
Fri, 23 Aug 2013 13:44:59 +0000 (14:44 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 26 Aug 2013 13:41:56 +0000 (06:41 -0700)
The `char file[]` variable in `do_dev_config()` doesn't need to be
initialized as it gets overwritten with a `snprintf()`.  It just needs
to be long enough.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/comedi_bond.c

index 253a67da8e03b8c7f8523407cb45c247aa0255c3..00c065a3dafdfc7a689c5e5d8da470e4fb3fdeac 100644 (file)
@@ -200,7 +200,7 @@ static int do_dev_config(struct comedi_device *dev, struct comedi_devconfig *it)
         * building our device list.
         */
        for (i = 0; i < COMEDI_NDEVCONFOPTS && (!i || it->options[i]); ++i) {
-               char file[] = "/dev/comediXXXXXX";
+               char file[sizeof("/dev/comediXXXXXX")];
                int minor = it->options[i];
                struct comedi_device *d;
                int sdev = -1, nchans, tmp;