Skip to content

Commit 888f67e

Browse files
andy-shevgregkh
authored andcommitted
driver core: Use 2-argument strscpy()
Use 2-argument strscpy(), which is not only shorter but also provides an additional check that destination buffer is an array. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent d136303 commit 888f67e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/base/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4867,7 +4867,7 @@ set_dev_info(const struct device *dev, struct dev_printk_info *dev_info)
48674867
else
48684868
return;
48694869

4870-
strscpy(dev_info->subsystem, subsys, sizeof(dev_info->subsystem));
4870+
strscpy(dev_info->subsystem, subsys);
48714871

48724872
/*
48734873
* Add device identifier DEVICE=:

0 commit comments

Comments
 (0)