]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
PM / devfreq: Replace strncpy with strscpy
authorDmitry Osipenko <digetx@gmail.com>
Thu, 27 Feb 2020 17:08:54 +0000 (20:08 +0300)
committerChanwoo Choi <cw00.choi@samsung.com>
Thu, 28 May 2020 09:02:39 +0000 (18:02 +0900)
commita316b5ca9ead8065ac873e655c313248ecd732bc
tree12c7e1a06d613c784d8753cc14db7d4c70b10dfd
parent02355216b4c00b1fe3f1e969aa15eca99240f8f3
PM / devfreq: Replace strncpy with strscpy

GCC produces this warning when kernel compiled using `make W=1`:

  warning: ‘strncpy’ specified bound 16 equals destination size [-Wstringop-truncation]
  772 |  strncpy(devfreq->governor_name, governor_name, DEVFREQ_NAME_LEN);

The strncpy doesn't take care of NULL-termination of the destination
buffer, while the strscpy does.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
drivers/devfreq/devfreq.c