]> git.baikalelectronics.ru Git - kernel.git/commit
usb: musb: dsps: fix res_name length
authorDaniel Mack <zonque@gmail.com>
Wed, 17 Oct 2012 20:17:35 +0000 (22:17 +0200)
committerFelipe Balbi <balbi@ti.com>
Tue, 23 Oct 2012 06:42:29 +0000 (09:42 +0300)
commitc5f0eb0ebdfc8586ea40cd7e9c50da84799ce5fb
tree762b6cc79baee90373f8ea82ec6690dee90942cb
parent6ab66186695d33c81b559545154047cd3436b033
usb: musb: dsps: fix res_name length

The res_name is used for the name construction of a DT property as
follows:

  sprintf(res_name, "port%d-mode", id);

Hence, res_name must be at least 11 characters long in order to store
the name including the terminating '\0'.

While at it, use to snprintf() rather than sprintf() when accessing this
buffer.

Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/musb/musb_dsps.c