Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp7218444rwn; Tue, 13 Sep 2022 16:20:52 -0700 (PDT) X-Google-Smtp-Source: AA6agR5U6uxWTx99FVjP8u86EyHtL8YVXp5PvKp3xmh3DDp6txzez8W/m50VmA7XipX+KyTH6ENn X-Received: by 2002:a17:907:75dc:b0:730:9c68:9a2e with SMTP id jl28-20020a17090775dc00b007309c689a2emr24936185ejc.22.1663111252541; Tue, 13 Sep 2022 16:20:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663111252; cv=none; d=google.com; s=arc-20160816; b=SYWm0p9m22WL/b1CSdBfL+LdhsbPTn0Xg8m1PrxX+zqKosnldyYxcfUyVpQH2xaztP Mhb+mIL98KTXgB/UINedXH3xJ0YlkCjSAsCZMeuxjjiknFOnNRgcIoJU8UPmHoSDsVfg mENoIvDe4sPGnNkr6X32BoY+cxF2U9q9ZjKdFJ3Bx0UlswkuoYNXvlDEtWD03N6bqqSU STGKm13lGWaqs/vwdEP8HkxXq57OrL5R+PED5FeROyrs3yDP11V/Yj+vkeyOq0w15f8H 3/rlnhWZo2KIOdxiJG0vi2PVxYWBQJBu0ASQWB1iUav2WGIUgz2+acX0KgwXzAH5Q2yf WqUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=BVHcob34dY/4oAIV5PbpvdEQyMDawDTzmu05k1v2CFM=; b=w3M2o/yzlZ/lxAEZhzwp2uHraNVRTKkOpwN6dEHIQT/c4/S+Qy1R0cV8FHOloQHrSu nwmuZ2lAFgmN/vTMe35p+yi4hGKi+kyD0Zzt5gZUYoC/yB0kLnqSkOW1UxgTEM15PRe1 baQpv/Yhg19kDpTgrCFTebu9kCGTPnx61XJA2WzUHeOyJ8RzA7Z36KKyC8kccP+P/Zjm aJz8hrGYXuQFcI/b/BJovDKouZRmMJou3CvnsHe4wFxXXhUIT5J74Rbor51VTQjGlEEo 2rAA7ljkOsEJVaIE/D9s6+955dj88oskXClc9S+I9j6p9LcJtO9a1Jl+OoO+BIX410Rg YI3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tIATb4ij; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ga33-20020a1709070c2100b0073d7ce7e954si10179439ejc.695.2022.09.13.16.20.26; Tue, 13 Sep 2022 16:20:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tIATb4ij; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229693AbiIMXJj (ORCPT + 99 others); Tue, 13 Sep 2022 19:09:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229759AbiIMXJe (ORCPT ); Tue, 13 Sep 2022 19:09:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F3022637 for ; Tue, 13 Sep 2022 16:09:33 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id B42016164B for ; Tue, 13 Sep 2022 23:09:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94563C433C1; Tue, 13 Sep 2022 23:09:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663110572; bh=pcH19MK6ESI/9MZwdBzNsbd8GjA8eDK+xjnqH2krCP4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tIATb4ijmbgnmb9gCpxebU0lphb4lYu3ILc1nFy44RfIxfsWEjJWZL5XWwCT/aQJl yNLwMhVcFsh9/WFjwLmdNc/ZIiNSVkSMb1B0+S3+sZn4G38TQ1wcjTs56RDZtAflP9 zbhJx4Fh1y08Z2RvmQ3FjLxeSReIS6PGnDYtvjmwr3Mpahp6u639iiTY/MNlXplCY6 8IYhDG93rMRtT/MGufRw09D+ZVvPbwWm7zWK8ovzUlq4dYKmvsp9pO2CJKTcjBs3Ic TDdeUMfHSCiAm3/tLJEE0V1n9eLwGdPzxGFpr4mPlJuft8VRYBZ+M1osxDXSCO8g9h LBE+e9mA+DuMw== Date: Tue, 13 Sep 2022 16:09:29 -0700 From: Nathan Chancellor To: Nathan Huckleberry Cc: Dan Carpenter , llvm@lists.linux.dev, Greg Kroah-Hartman , Nick Desaulniers , Tom Rix , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: rtl8192u: Fix return type of ieee80211_xmit Message-ID: References: <20220912214559.929186-1-nhuck@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220912214559.929186-1-nhuck@google.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 On Mon, Sep 12, 2022 at 02:45:56PM -0700, Nathan Huckleberry wrote: > The ndo_start_xmit field in net_device_ops is expected to be of type > netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb, struct net_device *dev). > > The mismatched return type breaks forward edge kCFI since the underlying > function definition does not match the function hook definition. > > The return type of ieee80211_xmit should be changed from int to > netdev_tx_t. > > Reported-by: Dan Carpenter > Link: https://github.com/ClangBuiltLinux/linux/issues/1703 > Cc: llvm@lists.linux.dev > Signed-off-by: Nathan Huckleberry The protoype in drivers/staging/rtl8192u/ieee80211/ieee80211.h should be updated as well. With that: Reviewed-by: Nathan Chancellor > --- > drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c > index 8602e3a6c837..e4b6454809a0 100644 > --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c > +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c > @@ -526,7 +526,7 @@ static void ieee80211_query_seqnum(struct ieee80211_device *ieee, > } > } > > -int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) > +netdev_tx_t ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) > { > struct ieee80211_device *ieee = netdev_priv(dev); > struct ieee80211_txb *txb = NULL; > @@ -822,13 +822,13 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) > if ((*ieee->hard_start_xmit)(txb, dev) == 0) { > stats->tx_packets++; > stats->tx_bytes += __le16_to_cpu(txb->payload_size); > - return 0; > + return NETDEV_TX_OK; > } > ieee80211_txb_free(txb); > } > } > > - return 0; > + return NETDEV_TX_OK; > > failed: > spin_unlock_irqrestore(&ieee->lock, flags); I see 'return 1' down here, that doesn't appear to be a valid 'netdev_tx_t'. Should that be 'return NETDEV_TX_BUSY'? I guess that is an outstanding issue though, just figured I would mention it. > -- > 2.37.2.789.g6183377224-goog > Cheers, Nathan