lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1653897933-25931-1-git-send-email-baihaowen@meizu.com>
Date:   Mon, 30 May 2022 16:05:32 +0800
From:   Haowen Bai <baihaowen@...zu.com>
To:     Larry Finger <Larry.Finger@...inger.net>,
        Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
CC:     Haowen Bai <baihaowen@...zu.com>, <linux-staging@...ts.linux.dev>,
        <linux-kernel@...r.kernel.org>
Subject: [PATCH] staging: rtl8712: Fix pointer dereferenced before checking

The padapter->recvpriv.signal_qual_data is dereferencing before null
checking, so move it after checking.

Signed-off-by: Haowen Bai <baihaowen@...zu.com>
---
 drivers/staging/rtl8712/rtl8712_recv.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8712/rtl8712_recv.c b/drivers/staging/rtl8712/rtl8712_recv.c
index 7f1fdd058551..8ed94b259dbe 100644
--- a/drivers/staging/rtl8712/rtl8712_recv.c
+++ b/drivers/staging/rtl8712/rtl8712_recv.c
@@ -863,10 +863,12 @@ static void process_link_qual(struct _adapter *padapter,
 {
 	u32	last_evm = 0, tmpVal;
 	struct rx_pkt_attrib *pattrib;
-	struct smooth_rssi_data *sqd = &padapter->recvpriv.signal_qual_data;
+	struct smooth_rssi_data *sqd;
 
 	if (!prframe || !padapter)
 		return;
+
+	sqd = &padapter->recvpriv.signal_qual_data;
 	pattrib = &prframe->u.hdr.attrib;
 	if (pattrib->signal_qual != 0) {
 		/*
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ