Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3593113pxb; Mon, 24 Jan 2022 13:03:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJz8ft8YBV7K+h3IIgeYKHIso/Qab81ehdTPXjGfM+pVutasbEcvxYqqjPaBKvVXf7uDdkwr X-Received: by 2002:a63:7543:: with SMTP id f3mr12977090pgn.360.1643058222605; Mon, 24 Jan 2022 13:03:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643058222; cv=none; d=google.com; s=arc-20160816; b=yhu2Ld3AKzwdFS0lJY5Q3f8W0+AYUQeMATMx/XaPM1PqudyZhaAKgU7EC++nj7LHy+ jIF6n15idRDgxdU2c9I9PZgk9Xmyma16ZVMxgXog+A6YTuWyYy6aL7u/JwmU5bA8dpe0 Pk8c/j+Adhi53eN6maQjEE+ASGCrss7OhtrIm6EXigkue+Mc9Ysewk26zgMUWEvW2GVJ h1DJmEh/yaI1KEJVcAqRCS3MSiSeINsiDVMasrVJeV+9KkxKPYt9JDhBwGTFlgfHyvLR x5F3IQ7o0tj5h8VgrhDun87cag0h7lg7xtoEs90h9d0sXAEyvLoj3H7jv1BW6yHZDZ1a WVkg== 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=KUv1etSewe0wmauxrSrtXzCjutdtnYioMPLinjJKI+A=; b=Q+hWfnh2QSiA9ccnr+jmid8I7+hVruNHP6tBbEB6XHBh4SPECsK0WD5YgcyGjP0wlY vludt1M72j2ubVhXpwyaIdXYJ/zXxkdaRFRqEVs566GHHaEnJfFS8A1+ob0NV3WvZwCo 089RnwNOiKWfZO7QWivFcwIEO7Ax46RJAVY54F9xeutq6nYbYysVu/LdxJFVwGSXuV3I Ck/0qodvpQBBhfTphVxXqbXQd7N0VNW/H8VDq8w51GY6K/KFG0VKzg7VBLf7GYITpAeB Lg/zp0L3kFQO6/ZR7/ts6+G2rk/Nh/itL0lPdg2C6HllTl79zr3SpYlYyaN+Bdrwj3q0 Lkig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gCEZuOWS; 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 h190si5957842pge.868.2022.01.24.13.03.16; Mon, 24 Jan 2022 13:03:42 -0800 (PST) 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=gCEZuOWS; 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 S1383224AbiAXU06 (ORCPT + 99 others); Mon, 24 Jan 2022 15:26:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352528AbiAXT51 (ORCPT ); Mon, 24 Jan 2022 14:57:27 -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 16748C047CD7; Mon, 24 Jan 2022 11:27:49 -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 D16ABB8124F; Mon, 24 Jan 2022 19:27:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A340C340E8; Mon, 24 Jan 2022 19:27:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643052466; bh=2GpnY8vqsVSbMQOw9UMBU8BSPRxFPtHHdtM8Ph3ap/g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gCEZuOWSXCNIXsIZ362k7BB9mOOelRlU4PrN0NBEBQslkvZlzQ1IzglM6pc5FxO3x uf2QbA6Lem3LeTd9jVjdW7q/pPTshdGGYnrQZRvlWPtQ7ooMDG6HD4KtyrEFQbFXbz HFDXxVqyTU6fjmpjAb2+fBX5WsHY+6ij92UcsO7Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Pavel Skripkin , Yang Yingliang , Sasha Levin Subject: [PATCH 5.4 069/320] staging: rtl8192e: return error code from rtllib_softmac_init() Date: Mon, 24 Jan 2022 19:40:53 +0100 Message-Id: <20220124183956.071298714@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183953.750177707@linuxfoundation.org> References: <20220124183953.750177707@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: Yang Yingliang [ Upstream commit 68bf78ff59a0891eb1239948e94ce10f73a9dd30 ] If it fails to allocate 'dot11d_info', rtllib_softmac_init() should return error code. And remove unneccessary error message. Fixes: 94a799425eee ("From: wlanfae ") Reviewed-by: Dan Carpenter Reviewed-by: Pavel Skripkin Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20211202030704.2425621-2-yangyingliang@huawei.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/staging/rtl8192e/rtllib.h | 2 +- drivers/staging/rtl8192e/rtllib_softmac.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h index 2eeb9a43734e3..49bf3ad31f912 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -1982,7 +1982,7 @@ void rtllib_softmac_xmit(struct rtllib_txb *txb, struct rtllib_device *ieee); void rtllib_stop_send_beacons(struct rtllib_device *ieee); void notify_wx_assoc_event(struct rtllib_device *ieee); void rtllib_start_ibss(struct rtllib_device *ieee); -void rtllib_softmac_init(struct rtllib_device *ieee); +int rtllib_softmac_init(struct rtllib_device *ieee); void rtllib_softmac_free(struct rtllib_device *ieee); void rtllib_disassociate(struct rtllib_device *ieee); void rtllib_stop_scan(struct rtllib_device *ieee); diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index f2f7529e7c80e..4ff8fd694c600 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -2952,7 +2952,7 @@ void rtllib_start_protocol(struct rtllib_device *ieee) } } -void rtllib_softmac_init(struct rtllib_device *ieee) +int rtllib_softmac_init(struct rtllib_device *ieee) { int i; @@ -2963,7 +2963,8 @@ void rtllib_softmac_init(struct rtllib_device *ieee) ieee->seq_ctrl[i] = 0; ieee->dot11d_info = kzalloc(sizeof(struct rt_dot11d_info), GFP_ATOMIC); if (!ieee->dot11d_info) - netdev_err(ieee->dev, "Can't alloc memory for DOT11D\n"); + return -ENOMEM; + ieee->LinkDetectInfo.SlotIndex = 0; ieee->LinkDetectInfo.SlotNum = 2; ieee->LinkDetectInfo.NumRecvBcnInPeriod = 0; @@ -3031,6 +3032,7 @@ void rtllib_softmac_init(struct rtllib_device *ieee) (void(*)(unsigned long)) rtllib_sta_ps, (unsigned long)ieee); + return 0; } void rtllib_softmac_free(struct rtllib_device *ieee) -- 2.34.1