Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1701803pxb; Wed, 9 Feb 2022 02:35:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJz4v7mOaGR0RCa8Sl0h8iWwvZdR4LPPkBMH9kj7BpyHFvmQTPEhGlSzQv6DzneKou80FMTr X-Received: by 2002:a63:10:: with SMTP id 16mr1353511pga.87.1644402953923; Wed, 09 Feb 2022 02:35:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644402953; cv=none; d=google.com; s=arc-20160816; b=rl3996oXJo0uuA6twuPJ64xbdq5sHTFHPs0QPyypNhaFwtWGRGHuBZ9Bsfp7zaatiB 46Qk0OrxlNTURl4MhUH83t5wKyPrjhCzqhi3Y65dqb58Fze08ICDFa41M+MhMK4NtN/M L4bsQ9nm75hGdsyxYNNM9OT9miPU4nFibFbGkRGWUuk9sfqPO1wpaLw8a+PSWv3UxHoz 9jJzocm+9qAO55dHIBxTtK9OLyBpKKl9Iu4itv7m2JZAyvkHEtaj9w2a/4U/HSKHzrOc x3SN1ltik+nywhwyQq2viVdW9fmk7XAtj1kgzlf2KklZeVdI+GpRpich/TWuK0TPA085 bLPA== 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=bGBNsr3Es5BLvrdF5oRDIc04ajLUUnavrSOuNqVd4w8=; b=gjb5O+vXf14CCJalC/GqMB90yxJfsMvcMTT5gcGlJWhmuCkBOf02LvaptoD0ak2t56 dqHl13b5X/Zup5Yr/hzv3YorvHf70bAiH7M01FB8Z3HyTjyFyRbFlQcAt6FWwL1r+VIz pvuePHhSqmTQuI8sOaSrzxcSVlNC0nUto4JiGPVEF4NLYVg7LQKbzgOANusvIj5AzPYx PIjWEn/VK+0FNMaio/TJTwmv7H0SbjYOzJFH14a2bEPVY+5TA/Tqn/EqCNM5G2nlSnNH EBFyenFxAM5T/oWB8WWgoRstG45ZpFg62dO/UMy0klUyb0PH/PP6mhJglxw2WmvMngq5 Xzlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=m+SctpmG; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id f17si15551682pfe.381.2022.02.09.02.35.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 02:35:53 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=m+SctpmG; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3EC62E0A81D1; Wed, 9 Feb 2022 01:23:14 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1387913AbiBGLmM (ORCPT + 99 others); Mon, 7 Feb 2022 06:42:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381426AbiBGL3P (ORCPT ); Mon, 7 Feb 2022 06:29:15 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70E1CC02B660; Mon, 7 Feb 2022 03:27:17 -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 0357BB811B3; Mon, 7 Feb 2022 11:27:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EF1FDC004E1; Mon, 7 Feb 2022 11:27:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644233234; bh=KWI6vSg9iJAy0sZw7ylDuPKoHk9LZwGvR0dTqATAMdo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m+SctpmGjyHAgYwpKIDM9IOb8HMeZD8Hsf9OmOS9+z0v+WHl/AQhMKUrhpJyWEP6p 1dyKPKNNBtcF/tuVM+Jv8WSkbFa4xdpa1iDMpa84DCZqiq0norXy7GB+LKgRIu+9vm U8CCh3nz65A8k0YcV+OsvyKPxAUjRjdPpNoKBQB4= 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 5.15 060/110] net: ieee802154: Return meaningful error codes from the netlink helpers Date: Mon, 7 Feb 2022 12:06:33 +0100 Message-Id: <20220207103804.313182681@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220207103802.280120990@linuxfoundation.org> References: <20220207103802.280120990@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 @@ -1441,7 +1441,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; @@ -1634,7 +1634,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; @@ -1812,7 +1812,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; @@ -1988,7 +1988,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;