Skip to content

Commit

Permalink
Input: do not overwrite the first part of phys string
Browse files Browse the repository at this point in the history
Use strlcat() to append a string to the previously created first part.

Signed-off-by: Márton Németh <nm127@freemail.hu>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
  • Loading branch information
Márton Németh authored and Dmitry Torokhov committed Nov 23, 2009
1 parent 52ce4ea commit 6236dfa
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion drivers/hid/usbhid/usbkbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ static int usb_kbd_probe(struct usb_interface *iface,
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;
Expand Down
2 changes: 1 addition & 1 deletion drivers/input/misc/ati_remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ static int ati_remote_probe(struct usb_interface *interface, const struct usb_de
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));
Expand Down
2 changes: 1 addition & 1 deletion drivers/input/misc/powermate.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ static int powermate_probe(struct usb_interface *intf, const struct usb_device_i
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);

Expand Down

0 comments on commit 6236dfa

Please sign in to comment.