]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
SUNRPC: move from strlcpy with unused retval to strscpy
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Thu, 18 Aug 2022 21:02:29 +0000 (23:02 +0200)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Mon, 3 Oct 2022 15:26:36 +0000 (11:26 -0400)
Follow the advice of the below link and prefer 'strscpy' in this
subsystem. Conversion is 1:1 because the return value is not used.
Generated by a coccinelle script.

Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
net/sunrpc/xprtsock.c

index e976007f4fd00f2c6238c9756370dd3231f2c98a..b3341c202ea0749d51ba9b4f977d2c39743fd50c 100644 (file)
@@ -261,7 +261,7 @@ static void xs_format_common_peer_addresses(struct rpc_xprt *xprt)
        switch (sap->sa_family) {
        case AF_LOCAL:
                sun = xs_addr_un(xprt);
-               strlcpy(buf, sun->sun_path, sizeof(buf));
+               strscpy(buf, sun->sun_path, sizeof(buf));
                xprt->address_strings[RPC_DISPLAY_ADDR] =
                                                kstrdup(buf, GFP_KERNEL);
                break;