Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3130625ybl; Sun, 2 Feb 2020 15:26:58 -0800 (PST) X-Google-Smtp-Source: APXvYqxhUog6Y1XdgNUSM90gzbj97Ktd9pVGzafwDXTMt1vmUzrIKLHyl7RjI159MjWJxksOusge X-Received: by 2002:a05:6830:20c4:: with SMTP id z4mr16346048otq.260.1580686018818; Sun, 02 Feb 2020 15:26:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580686018; cv=none; d=google.com; s=arc-20160816; b=WjwrrrwafiYIxCqFkkqc4dxL6BrnORipJgvhpI4ctf/PbvJdobRkjQg9p8xTjJDYar fOERGTLxv7BMZ4DzrU1fjDMECjKcxWZ1Q1U8ZxrKvPcGYcei5ZdQqGCyT4oyLsAlTmce h21ZbZEE48khXufpLeJz5fqFAwQzzPDdSH91/dp+MxXZouOCKiyNSl2PML8aMXG492om p5I9ie5TYsYnkgvYu7ZsAwLqv2c75ns39S3MS3OWlrBwTEGiyVeRErAALDIOvRdzOgAv VM3Nsss8NUS8WkSiIB5cKIgnQn+Ejs4PC1HWWF9GdfnEITwYEYJn812mnjabiSiLtiXo VdFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Zl75aPTk5GQwwI1uRlWeXrMVCwJuDdcVhpEeIXvEHyU=; b=Rh8+u6WS8l94+sBeLyI879FuhTrmqfE+M0fh6MtALUq05SN82BOV4bt5IgkFMj9D2m Eg7UEvwxGyMsOePGBuhTcHJ6tl+fDer6vHL/aXsOLGqf170Grvvw0eluwMzUVj/+mo7M rqfu6+14OjUSTwqbLy2PGbcKZgVkuOxLwJxar1ZDKzkCgLRjlAwQ3gEbbP4Io/zzkoHA mLCW4Vm951KKGxjVnsA6VBj8JaaIgaSnJnjVlnRZJURRqJcR6VMN6xhfip3q8QsQ8q+O AC7kctyAGPwZpmWybh2HHM7mewFPlY8oHnil6RuD8dCAWVLo8ddhWpJaYaRMQjK2hlFE XSYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FdhKsqv0; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o16si8048570otp.289.2020.02.02.15.26.46; Sun, 02 Feb 2020 15:26:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FdhKsqv0; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726637AbgBBW7T (ORCPT + 99 others); Sun, 2 Feb 2020 17:59:19 -0500 Received: from mail-yw1-f65.google.com ([209.85.161.65]:44858 "EHLO mail-yw1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726443AbgBBW7T (ORCPT ); Sun, 2 Feb 2020 17:59:19 -0500 Received: by mail-yw1-f65.google.com with SMTP id t141so11938206ywc.11 for ; Sun, 02 Feb 2020 14:59:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Zl75aPTk5GQwwI1uRlWeXrMVCwJuDdcVhpEeIXvEHyU=; b=FdhKsqv08yy81iscVOJBiBlR9GJXdbpxSE6Cnej8rCnQLnD6LwLGGHPmM6g+mQHU0/ tAgScBiYqTM6doWoVOz84hdHU8JFnsmkX7OL7sRZZB+ub8PdU15vnBiWEB0GmmrkxKRs IZ3baN0KNXyWOWlTTuqiU+KmiBbdq+05AyB3SOaN6gVJ+tgzSbBEdjOt/nV21rGzlAO2 0fntBxdESBtfi3zccNgoSK1+dzBOW4jEPuVKt3Htj5UZUmKHr/4lKByCKS+N1izSh2rQ 4I31rYML/sSBbNatvtNpd2W28UwEToyjCm0KOvLWCDytrQg1hn7D16g+N9ILQXlutPLx XVGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Zl75aPTk5GQwwI1uRlWeXrMVCwJuDdcVhpEeIXvEHyU=; b=tp8mJD5MbE7o8HUfDUeRXTSWGj0eqTuKwxKG9NLZOJ7Q/5VDj7mxeB7dKexzllYeFy Aa0b6krCzeJuVNbwRZEqeqbXg53zvSF2j920cd6lcrgUlJjDRmMc3zJDI26N5RqQc8mh AMqQTyY9ZL3SNyOri8f57LC/y/zoVPKP2L6guR57ihv0H9a+MxdjWCrBQ64JyY4VfrGn Ym42YCCWQcP/i/lhmnphkDqYH8Ovvg4T18fZrYDHMgHVazLcViBCUnYdV9RFidu70B55 vPB48Xuu9rC8Kl5dquwBwwJ/bEHyJf1bsg4EmES9I5+XoxIIUSMLuC4Y7Ahpel3AVeVy mMPA== X-Gm-Message-State: APjAAAVyMQIc/fAiyf8Rm88mq6JO+uU3OVj7vmjlyPzQrJGHVn2iAvvJ JFf4hWUOBG8e4Q8qdbNsrg== X-Received: by 2002:a25:420c:: with SMTP id p12mr18557519yba.86.1580684358510; Sun, 02 Feb 2020 14:59:18 -0800 (PST) Received: from localhost.localdomain (c-68-40-189-247.hsd1.mi.comcast.net. [68.40.189.247]) by smtp.gmail.com with ESMTPSA id j11sm7532238ywg.37.2020.02.02.14.59.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Feb 2020 14:59:18 -0800 (PST) From: Trond Myklebust X-Google-Original-From: Trond Myklebust To: Anna Schumaker Cc: linux-nfs@vger.kernel.org Subject: [PATCH 2/2] SUNRPC: Use kmemdup_nul() in rpc_parse_scope_id() Date: Sun, 2 Feb 2020 17:57:08 -0500 Message-Id: <20200202225708.995271-2-trond.myklebust@hammerspace.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200202225708.995271-1-trond.myklebust@hammerspace.com> References: <20200202225708.995271-1-trond.myklebust@hammerspace.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Using kmemdup_nul() is more efficient when the length is known. Signed-off-by: Trond Myklebust --- net/sunrpc/addr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sunrpc/addr.c b/net/sunrpc/addr.c index d024af4be85e..8b4d72b1a066 100644 --- a/net/sunrpc/addr.c +++ b/net/sunrpc/addr.c @@ -175,7 +175,7 @@ static int rpc_parse_scope_id(struct net *net, const char *buf, return 0; len = (buf + buflen) - delim - 1; - p = kstrndup(delim + 1, len, GFP_KERNEL); + p = kmemdup_nul(delim + 1, len, GFP_KERNEL); if (p) { u32 scope_id = 0; struct net_device *dev; -- 2.24.1