Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3981982pxb; Tue, 25 Jan 2022 00:36:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJzGJr3ZUj6XKKfW3t8Pf2AZaSeeP31+BdExlpcaLQOIXZ1ooCz2LxW2rj7k6La2HCNU+DN2 X-Received: by 2002:a50:ec09:: with SMTP id g9mr19206655edr.198.1643099796922; Tue, 25 Jan 2022 00:36:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643099796; cv=none; d=google.com; s=arc-20160816; b=K2yLFYDirXpwoHwoZucZdhI9WC7oVN4+t4ak98z1sdCgyQqBiHXdHP11UJMFQJlc9a 5NaeHoopjzwK3OpYMv9qykXY85LKqt+JzdDsgRRUmcbuBkixaiLJF8R20q5LkMIbFbr6 A5FcSOei8E1cxtCBTAMHmkmjF9J3mNu0v/Oqqtp4p4xlxRQXB56ZAINNxnsnDYXxTAJU JnoVs5jGXym3bOXHcByz/jjW5GZgdA0iRCzbj/SQ1Udpk8u/zdT/rgFhvwyBPIbL5Qjy ijuCuXGHLUOSOuonLX15v5lNJly05y2sZHZPJuxONkMa3sxDipHWNXS0twN4hPp0iJgY gtlQ== 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=tyMxxnZE3gwzYMxfUnEWTSqn90lPMG5pUaR8m4Nwm60=; b=BCGfE7WSL3sjVKlN3i7d0yn8DoDNH9FhidV5XLMe4oecFOZA7zNktdZz2llJAaL2ML xG5NZRo3iXHRwtxKaMRKb1mADIMDW4uISUxcTnur8rqysa6fR8GsfiyOb+OS/V0dqDV/ bUI+IcgUrH1aKB1ifZhpOkNiiC/7MfPWWjTNby4Gk1Q1bROuMHt3LIfQY2FpN27/1j1S Yim0TC04Br9JGZyxTbPG9b/mjsSnP/w/KyZVzQ7xtFhoyBlpX+OVwCdVW6EG+jVfssU/ LdI6o5pnmKIPyNDaAMhlvtvrtqM8lFPMVgAa/Q7wEqvF47G6+uQzaI238UFRRRFj/2k1 SzqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jOukcjk6; 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 n6si7104236edw.263.2022.01.25.00.36.10; Tue, 25 Jan 2022 00:36:36 -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=jOukcjk6; 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 S1315031AbiAYCwU (ORCPT + 99 others); Mon, 24 Jan 2022 21:52:20 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:58614 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376965AbiAXVGR (ORCPT ); Mon, 24 Jan 2022 16:06:17 -0500 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 3ACD4B8121C; Mon, 24 Jan 2022 21:06:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60E9BC340E7; Mon, 24 Jan 2022 21:06:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643058374; bh=qIu40SqUO5KD28fEgzEEHatZGMorjGgeu74zFz8rpis=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jOukcjk6Qtd9KmgQOCdUYenvjx4wrtwOZIeKM82+tlW5hPSZhc7n1o9vJq0hfaadT IptbsggcpYOtJRVd6JpxSymkkbsQVZkOwtXSRrdYkQ2K3uHP0bteAz+Jr+GXVZDb8m YtJF8VDCpFaD1Xf1U1NfQ+35cEyEltZ5PItKB+PM= 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.16 0226/1039] staging: rtl8192e: return error code from rtllib_softmac_init() Date: Mon, 24 Jan 2022 19:33:35 +0100 Message-Id: <20220124184132.928520449@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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 c6f8b772335c1..c985e4ebc545a 100644 --- a/drivers/staging/rtl8192e/rtllib.h +++ b/drivers/staging/rtl8192e/rtllib.h @@ -1980,7 +1980,7 @@ void SendDisassociation(struct rtllib_device *ieee, bool deauth, u16 asRsn); void rtllib_softmac_xmit(struct rtllib_txb *txb, 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 d2726d01c7573..503d33be71d99 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; @@ -3029,6 +3030,7 @@ void rtllib_softmac_init(struct rtllib_device *ieee) tasklet_setup(&ieee->ps_task, rtllib_sta_ps); + return 0; } void rtllib_softmac_free(struct rtllib_device *ieee) -- 2.34.1