Date:2011-07-07 00:12:50 (9 years 6 days ago)
Author:Werner Almesberger
Commit:c35f50f5d1d804ff4d8523d8b20f36012bb066a2
Message:atusb: correctly print the build date

The code assumed the string send by atusb was NUL-terminated, which
it isn't. We therefore can only accept one byte less in the buffer
and must terminate the string ourselves.

Signed-off-by: Werner Almesberger <werner@almesberger.net>
Files: drivers/spi/atusb.c (1 diff)

Change Details

drivers/spi/atusb.c
494494    retval = usb_control_msg(dev,
495495        usb_rcvctrlpipe(atusb->udev, 0),
496496        ATUSB_BUILD, ATUSB_FROM_DEV, 0, 0,
497        build, ATUSB_BUILD_SIZE+1, 1000);
497        build, ATUSB_BUILD_SIZE, 1000);
498498    if (retval < 0) {
499499        dev_info(&dev->dev,
500500            "failed submitting urb for ATUSB_BUILD, error %d", retval);
501501        return retval == -ENOMEM ? retval : -EIO;
502502    }
503503
504    build[retval] = 0;
504505    dev_info(&dev->dev, "Firmware: build %s\n", build);
505506
506507    return 0;

Archive Download the corresponding diff file



interactive