Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4798793pxj; Wed, 9 Jun 2021 02:01:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXk6BHirbSmpjrnjz3YZ7tfdyLtuuBKjAoXwXcJRWgjj0mu34ZS8SX4WyAzScAOKevIv1v X-Received: by 2002:a17:906:264c:: with SMTP id i12mr27510292ejc.101.1623229293675; Wed, 09 Jun 2021 02:01:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623229293; cv=none; d=google.com; s=arc-20160816; b=FnQPkA6sjE6LUVskoTYR7t58J1NQ+nei6N1gYFFk0/eJ/5W+7ul0xToBO3PI5DiI2S 1Xs/1NkVXGrDuGvSCxJdktEb45M7ZHmFZucBPARvTzQBO7ieTwUzS+SR4u3U+VrdN8Lr nHt5PaiiMumdz5jRyUhCwScH9M/0S509b4MHe1ycpVO1t0WpnwAXrtL6A/vln9yob3J1 QJq+A8/28MDBZxMDWSvgDKfRu/mh3f0rd6a0TOOU/UabFB4x2GS0x6Iry88BwVHIVYtP XYp2zHughW3cThJJ8KntMzNZM3sGtWen0HxLrRwipyB/9jwVRBL1ZcdhXdvHRxb0j3fJ pdJA== 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=yayMJx3QCDKgZd7uX09wGnWVqBTzLL2ZvcfpAskeufA=; b=kKXI3GYjZwnJbOVql7KNiTQhAbvswyEgMf59xeKR3bLRSxaMcnqV12GRhw9dh7mFU5 mN6wQflAlRRRpt/5q2mv+AolKhb+V9uvau9PYso069oglKsx+6mFL/GYoQq5tu7t8R+r MHiZYp+M2XuwSICvCwkoZiFGkwcrnkWKzPql0kuu0BrRmF+F4NM9TOLr2azqc0+wyWgC 1LbFyob7S824klgQBfUL45SEzbA1SosshzoL0jQLKkvVUg5kuIa/rVDsCag3s8YwMuUa YmJHq7B7dRrnpHdVm3MLz2GAzjlKvyrq/ue+V+Pg4+TaIUEPGm8/+sqDDEwI67ukDMuO JYiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=I3B6S8aG; 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 m4si1916125edc.575.2021.06.09.02.01.10; Wed, 09 Jun 2021 02:01:33 -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=I3B6S8aG; 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 S233931AbhFHSbU (ORCPT + 99 others); Tue, 8 Jun 2021 14:31:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:55402 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234073AbhFHSbD (ORCPT ); Tue, 8 Jun 2021 14:31:03 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7398461352; Tue, 8 Jun 2021 18:29:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623176949; bh=x7LfzFnqzNmc4if07anFqfnShHWM0T/wNz8qDWSCL9k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I3B6S8aGjH8yLIxZ6tGIu2jX4ZHWUKPJ5XVNNFj6N9eiYWn4ly2zLUmDCVQtDyKS1 7w726r7oIouT6HMAFb7naDIQ4frko/Hugcwiv51H/A0wBbS8Gp5O6kInuBnsUZHgl2 kPTjsmdPUXKPx5J9PafYiWgHQL0Ex+3OUcqYJC9o= 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 4.4 08/23] ieee802154: fix error return code in ieee802154_llsec_getparams() Date: Tue, 8 Jun 2021 20:27:00 +0200 Message-Id: <20210608175926.812165445@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210608175926.524658689@linuxfoundation.org> References: <20210608175926.524658689@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 76691a07a2e0..fe31df8dc804 100644 --- a/net/ieee802154/nl-mac.c +++ b/net/ieee802154/nl-mac.c @@ -685,8 +685,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