Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4361918pxj; Tue, 8 Jun 2021 12:25:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzH4F+RDAo5Kluc9UdgoJgn8foy3tXwxTjgbWX5LNhRYq/hU2DsZnaXmI6GGN5d7UYQ46I7 X-Received: by 2002:a17:906:76d2:: with SMTP id q18mr24720832ejn.294.1623180313828; Tue, 08 Jun 2021 12:25:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623180313; cv=none; d=google.com; s=arc-20160816; b=l6ir26pHI7iFsKzRwP+QtGWpoEa1xeXSBqdc6FtmMZC8Bo+A8vux30T/THv4Jnt8DL tvDKv8a2xnbCZ1bt+ElC5XNsMqBkpjR+hXT/YLyFRPpHxKqtoT3DGl7LdlEAtvcvZfID 6Iz9IjnlQ+Mu2GvE69rjiyWP3/TzyCob0OBTbsdaDNYJSfxBJnsOtJiqeEqIPRVIv5HT KrBC6kWLPsuzyV4BMdoBLZ1Al/0VztgM4yq3EdJ6seabai+QcL0YRqpqt4XSkLELgz4H lI/gnBwDN+KYiZhbH5KiB0KtwzEPPECTLqle0PRCyVrCm3Y5w4wNy77ZYo8jS88LPNdD iTxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=PnheN4/u2EAFxwYcqTFNK/E/E6Fi//BbZuYHAzDYQEM=; b=n8DTJQzT63Tm42ZYNtRUz/YWaLhrJ+jRtUNTncy55FiMjhjCajE6zIoF1H4UQ2NLx6 oNBqjgN3fEW4Ul4anD6rSYa9j66jRxLdyr191wlrCEtqo3whBwVpbY3msxSwvJzAiWAW CO5gKo6SicW0baoPnMKBdqfiG+4Y1jzTuqv+DukB718nclLpA2LdXY/PlOMwmZPCIm0R Grr8GEPmhj1fH1euqTjmDf0JXzE5jPxuZpXZGD2yOrwXNcJPrIdhiM2EvNzpYL8FAngF Zw7cnHN3XW40g8krW0j0rSWX5VsifICaOlNh1XqKrQ+7DoopoYWyBbjQpGo3Q8Wsy5hT gKhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oylZdIJz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j5si452971eds.204.2021.06.08.12.24.47; Tue, 08 Jun 2021 12:25:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oylZdIJz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239434AbhFHTXT (ORCPT + 99 others); Tue, 8 Jun 2021 15:23:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:53136 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235638AbhFHTLJ (ORCPT ); Tue, 8 Jun 2021 15:11:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 61C596198D; Tue, 8 Jun 2021 18:48:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623178133; bh=tqoV/Xwjut6DEwcg/4mFsrEXaywVMFNdFvEo1H/Npc0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oylZdIJzJBWpzS+zMq9vui/xPc03LqIH17ho7CVgE+Q9jBW0DNea9WjPI4AYm/qUC sG3Bv0rgqmj8C17QoAOoIcsdraVzo7I/BJhSgQHlmf2YcmmURnjlpshjLVZSCQZDVZ fgh1vN7diVRcYR3yTklO3419PJtf+fT8TJZjTJaE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Wei Yongjun , Stefan Schmidt , Sasha Levin Subject: [PATCH 5.12 045/161] ieee802154: fix error return code in ieee802154_llsec_getparams() Date: Tue, 8 Jun 2021 20:26:15 +0200 Message-Id: <20210608175946.989033328@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210608175945.476074951@linuxfoundation.org> References: <20210608175945.476074951@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wei Yongjun [ Upstream commit 373e864cf52403b0974c2f23ca8faf9104234555 ] Fix to return negative error code -ENOBUFS from the error handling case instead of 0, as done elsewhere in this function. Fixes: 3e9c156e2c21 ("ieee802154: add netlink interfaces for llsec") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun Link: https://lore.kernel.org/r/20210519141614.3040055-1-weiyongjun1@huawei.com Signed-off-by: Stefan Schmidt Signed-off-by: Sasha Levin --- net/ieee802154/nl-mac.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/ieee802154/nl-mac.c b/net/ieee802154/nl-mac.c index 0c1b0770c59e..c23c152860b7 100644 --- a/net/ieee802154/nl-mac.c +++ b/net/ieee802154/nl-mac.c @@ -680,8 +680,10 @@ int ieee802154_llsec_getparams(struct sk_buff *skb, struct genl_info *info) nla_put_u8(msg, IEEE802154_ATTR_LLSEC_SECLEVEL, params.out_level) || nla_put_u32(msg, IEEE802154_ATTR_LLSEC_FRAME_COUNTER, be32_to_cpu(params.frame_counter)) || - ieee802154_llsec_fill_key_id(msg, ¶ms.out_key)) + ieee802154_llsec_fill_key_id(msg, ¶ms.out_key)) { + rc = -ENOBUFS; goto out_free; + } dev_put(dev); -- 2.30.2