> +static ssize_t device_read_driver(struct device * dev, char * buf,
> size_t count, loff_t off)
> +{
> + if (dev->driver)
> + return off ? 0 : sprintf(buf,"%s\n",dev->driver->name);
You aren't checking that the name will fit in the supplied buffer - what
is there isn't enough space? Shouldn't you either use snprintf, a
strncpy, or a maximum field width in the sprintf?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/