From patchwork Thu Aug 18 21:02:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 12947968 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F3F7C00140 for ; Thu, 18 Aug 2022 21:11:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346848AbiHRVLq (ORCPT ); Thu, 18 Aug 2022 17:11:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346902AbiHRVKq (ORCPT ); Thu, 18 Aug 2022 17:10:46 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC837C12EB for ; Thu, 18 Aug 2022 14:05:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=sang-engineering.com; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=k1; bh=qKSPB8gFD0NJ0qs9VonIYMxQcGI /0b/oylVr6PInZQk=; b=qjK1vg+UM62/+ES4V5dqzpAo6pMnzTRcXZKF10oH7rY UPadUDbfHSPJn9jMmDp9FIW9N9wUX/+g5OZLQTsJhHOQuZ2URMFXHSFohFFBUkgq 59BWfhp5MrRxz9FZJsPRNh1B0Gl4j0NBeFNYJ5mkRfmQVbgpX+Mw9JVgMFbkwIUk = Received: (qmail 3963349 invoked from network); 18 Aug 2022 23:02:30 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 18 Aug 2022 23:02:30 +0200 X-UD-Smtp-Session: l3s3148p1@chitTIrmy8oucref From: Wolfram Sang To: linux-kernel@vger.kernel.org Cc: Wolfram Sang , Chuck Lever , Jeff Layton , Trond Myklebust , Anna Schumaker , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-nfs@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH] SUNRPC: move from strlcpy with unused retval to strscpy Date: Thu, 18 Aug 2022 23:02:29 +0200 Message-Id: <20220818210229.8659-1-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org 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 --- net/sunrpc/xprtsock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index e976007f4fd0..b3341c202ea0 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c @@ -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;