From afd707dd48a82993fa81dad7ad21e4d25c628f0d Mon Sep 17 00:00:00 2001 From: Sravan Kumar Kairam Date: Sun, 11 Aug 2019 18:43:30 +0530 Subject: [PATCH] qcacmn: Do vdev null check sanity before gro flush In dp_rx_process there are two cases in which vdev will be null. One is when peer is invalid case which happens when packets comes on reo with out any valid peer and vdev set. Second case is fetching more data in case of napi no yield condition and there are no buffers to fetch. In current dp_rx_process gro flush is called at the end of nbuff process and with out checking for vdev sanity it is referenced. So add vdev null sanity check to prevent NULL pointer dereference. Change-Id: Ie2d480108118d9b83373a450aecabee57675c41d CRs-Fixed: 2507067 --- dp/wifi3.0/dp_rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dp/wifi3.0/dp_rx.c b/dp/wifi3.0/dp_rx.c index 90d809aff6..fbc9087467 100644 --- a/dp/wifi3.0/dp_rx.c +++ b/dp/wifi3.0/dp_rx.c @@ -2158,7 +2158,7 @@ done: goto more_data; } - if (vdev->osif_gro_flush && rx_ol_pkt_cnt) { + if (vdev && vdev->osif_gro_flush && rx_ol_pkt_cnt) { vdev->osif_gro_flush(vdev->osif_vdev, reo_ring_num); }