From: Rongjun Chen Date: Thu, 13 Dec 2018 02:05:27 +0000 (+0800) Subject: wifi: fix r311 wifi panic issue [1/1] X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=aa25c0d56cb754945088c8c65cbbc16041bc2091;p=GitHub%2FLineageOS%2FG12%2Fandroid_hardware_amlogic_kernel-modules_dhd-driver.git wifi: fix r311 wifi panic issue [1/1] PD#SWPL-3107 Problem: r311 autoreboot wifi panic Solution: fix the null pointer issue Verify: r311 Change-Id: Ia2d1f402ffa5a46e2bfb5367ba79890f8b8d3cc8 --- diff --git a/bcmdhd.1.579.77.41.1.cn/dhd_linux.c b/bcmdhd.1.579.77.41.1.cn/dhd_linux.c index 0264224..9d769fe 100644 --- a/bcmdhd.1.579.77.41.1.cn/dhd_linux.c +++ b/bcmdhd.1.579.77.41.1.cn/dhd_linux.c @@ -13826,8 +13826,10 @@ err: void dhd_os_close_image(void *image) { - if (image) - filp_close((struct file *)image, NULL); + struct file *filp = image; + + if (filp && filp->f_op) + filp_close(filp, NULL); } void