do not overwrite the first part of phys string
Subsystems (4)
PATCH 1/1 do not overwrite the first part of phys string
From: Márton Németh <[email protected]>
Use strlcat() to append a string to the previously created first part.
---
drivers/hid/usbhid/usbkbd.c +1 -1
@@ -266,7 +266,7 @@ static int usb_kbd_probe(struct usb_inte le16_to_cpu(dev->descriptor.idProduct));usb_make_path (dev, kbd->phys,sizeof (kbd->phys)); -strlcpy (kbd->phys,"/input0" ,sizeof (kbd->phys)); +strlcat (kbd->phys,"/input0" ,sizeof (kbd->phys)); input_dev->name = kbd->name; input_dev->phys = kbd->phys;
drivers/input/misc/ati_remote.c +1 -1
@@ -766,7 +766,7 @@ static int ati_remote_probe(struct usb_i ati_remote->interface = interface;usb_make_path (udev, ati_remote->phys,sizeof (ati_remote->phys)); -strlcpy (ati_remote->phys,"/input0" ,sizeof (ati_remote->phys)); +strlcat (ati_remote->phys,"/input0" ,sizeof (ati_remote->phys));if (udev->manufacturer)strlcpy (ati_remote->name, udev->manufacturer,sizeof (ati_remote->name));
drivers/input/misc/powermate.c +1 -1
@@ -338,7 +338,7 @@ static int powermate_probe(struct usb_in pm->input = input_dev;usb_make_path (udev, pm->phys,sizeof (pm->phys)); -strlcpy (pm->phys,"/input0" ,sizeof (pm->phys)); +strlcat (pm->phys,"/input0" ,sizeof (pm->phys));spin_lock_init (&pm->lock);
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 1/1 dvb ttusb-dec: do not overwrite the first part of phys string
From: Márton Németh <[email protected]>
Use strlcat() to append a string to the previously created first part.
The semantic match that finds this kind of problem is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@@
expression dev;
expression phys;
expression str;
expression size;
@@
usb_make_path(dev, phys, size);
- strlcpy(phys, str, size);
+ strlcat(phys, str, size);
// </smpl>
---
drivers/media/dvb/ttusb-dec/ttusb_dec.c 2009-11-21 17:30:10.000000000 +0100 renamed from drivers/media/dvb/ttusb-dec/ttusb_dec.c 2009-09-10 00:13:59.000000000 +0200 +1 -1
@@ -1198,7 +1198,7 @@ static int ttusb_init_rc( struct ttusb_d int err; usb_make_path(dec->udev, dec->rc_phys, sizeof(dec->rc_phys)); - strlcpy(dec->rc_phys, "/input0", sizeof(dec->rc_phys)); + strlcat(dec->rc_phys, "/input0", sizeof(dec->rc_phys)); input_dev = input_allocate_device(); if (!input_dev)
Dmitry Torokhov
maintainerJiri,
Do you want to split out usbkbd section or do you want me to pick up everything?
Thanks.
Quoted 42 lines · Németh Márton
From: Márton Németh <[email protected]>
Use
strlcat()to append a string to the previously created first part.Signed-off-by Márton Németh <[email protected]>---
diff -uprlinux-2.6.32-rc7.orig/drivers/hid/usbhid/usbkbd.clinux-2.6.32-rc7/drivers/hid/usbhid/usbkbd.cdrivers/hid/usbhid/usbkbd.c +1
-1@@ -266,7 +266,7 @@ static int usb_kbd_probe(struct usb_inte le16_to_cpu(dev->descriptor.idProduct));usb_make_path (dev, kbd->phys,sizeof (kbd->phys)); -strlcpy (kbd->phys,"/input0" ,sizeof (kbd->phys)); +strlcat (kbd->phys,"/input0" ,sizeof (kbd->phys)); input_dev->name = kbd->name; input_dev->phys = kbd->phys;diff -upr
linux-2.6.32-rc7.orig/drivers/input/misc/ati_remote.clinux-2.6.32-rc7/drivers/input/misc/ati_remote.cdrivers/input/misc/ati_remote.c +1
-1@@ -766,7 +766,7 @@ static int ati_remote_probe(struct usb_i ati_remote->interface = interface;usb_make_path (udev, ati_remote->phys,sizeof (ati_remote->phys)); -strlcpy (ati_remote->phys,"/input0" ,sizeof (ati_remote->phys)); +strlcat (ati_remote->phys,"/input0" ,sizeof (ati_remote->phys));if (udev->manufacturer)strlcpy (ati_remote->name, udev->manufacturer,sizeof (ati_remote->name));diff -upr
linux-2.6.32-rc7.orig/drivers/input/misc/powermate.clinux-2.6.32-rc7/drivers/input/misc/powermate.cdrivers/input/misc/powermate.c +1
-1@@ -338,7 +338,7 @@ static int powermate_probe(struct usb_in pm->input = input_dev;usb_make_path (udev, pm->phys,sizeof (pm->phys)); -strlcpy (pm->phys,"/input0" ,sizeof (pm->phys)); +strlcat (pm->phys,"/input0" ,sizeof (pm->phys));spin_lock_init (&pm->lock);
Signature · 5 lines
Dmitry -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Jiri Kosina
Acked-byQuoted 2 lines · Dmitry Torokhov
Do you want to split out usbkbd section or do you want me to pick up everything?
Please go ahead with everything.
for that part, FWIW.
Thanks,
Signature · 2 lines
Jiri Kosina SUSE Labs, Novell Inc.