From mboxrd@z Thu Jan 1 00:00:00 1970 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 175C7C352B6 for ; Mon, 7 Feb 2022 11:14:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356089AbiBGLMy (ORCPT ); Mon, 7 Feb 2022 06:12:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343596AbiBGLJk (ORCPT ); Mon, 7 Feb 2022 06:09:40 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B41DC043181; Mon, 7 Feb 2022 03:09:40 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id F0B32B80EE8; Mon, 7 Feb 2022 11:09:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3A815C004E1; Mon, 7 Feb 2022 11:09:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644232177; bh=kIOnlIL+ZpfpueiBTUh+F+Rlr+J6FU0lZxLynHKRHRc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WotOWhz28aFxt7SdBMqVoIJ+ZoHOsXxiB69BvLvuYFCEwyW/uzXnf2Y5Z2bfw0yKQ /IjCaXZ2hpe/nLJadl5HYHMC4IOZ2Moe8SDnXprrGI14lHHTCUuUq8cqFLz0qqG5lo wjxs9T7nVLkvsGx0V3QS2eY0l3Swt+P81FOun+DQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miquel Raynal , Alexander Aring , Stefan Schmidt Subject: [PATCH 4.9 40/48] net: ieee802154: Return meaningful error codes from the netlink helpers Date: Mon, 7 Feb 2022 12:06:13 +0100 Message-Id: <20220207103753.637034831@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220207103752.341184175@linuxfoundation.org> References: <20220207103752.341184175@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: Miquel Raynal commit 79c37ca73a6e9a33f7b2b7783ba6af07a448c8a9 upstream. Returning -1 does not indicate anything useful. Use a standard and meaningful error code instead. Fixes: a26c5fd7622d ("nl802154: add support for security layer") Signed-off-by: Miquel Raynal Acked-by: Alexander Aring Link: https://lore.kernel.org/r/20220125121426.848337-6-miquel.raynal@bootlin.com Signed-off-by: Stefan Schmidt Signed-off-by: Greg Kroah-Hartman --- net/ieee802154/nl802154.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/net/ieee802154/nl802154.c +++ b/net/ieee802154/nl802154.c @@ -1474,7 +1474,7 @@ static int nl802154_send_key(struct sk_b hdr = nl802154hdr_put(msg, portid, seq, flags, cmd); if (!hdr) - return -1; + return -ENOBUFS; if (nla_put_u32(msg, NL802154_ATTR_IFINDEX, dev->ifindex)) goto nla_put_failure; @@ -1665,7 +1665,7 @@ static int nl802154_send_device(struct s hdr = nl802154hdr_put(msg, portid, seq, flags, cmd); if (!hdr) - return -1; + return -ENOBUFS; if (nla_put_u32(msg, NL802154_ATTR_IFINDEX, dev->ifindex)) goto nla_put_failure; @@ -1843,7 +1843,7 @@ static int nl802154_send_devkey(struct s hdr = nl802154hdr_put(msg, portid, seq, flags, cmd); if (!hdr) - return -1; + return -ENOBUFS; if (nla_put_u32(msg, NL802154_ATTR_IFINDEX, dev->ifindex)) goto nla_put_failure; @@ -2020,7 +2020,7 @@ static int nl802154_send_seclevel(struct hdr = nl802154hdr_put(msg, portid, seq, flags, cmd); if (!hdr) - return -1; + return -ENOBUFS; if (nla_put_u32(msg, NL802154_ATTR_IFINDEX, dev->ifindex)) goto nla_put_failure;