wifi: fix r311 wifi panic issue [1/1]
authorRongjun Chen <rongjun.chen@amlogic.com>
Thu, 13 Dec 2018 02:05:27 +0000 (10:05 +0800)
committerRongjun Chen <rongjun.chen@amlogic.com>
Thu, 13 Dec 2018 02:05:27 +0000 (10:05 +0800)
PD#SWPL-3107

Problem:
r311 autoreboot wifi panic

Solution:
fix the null pointer issue

Verify:
r311

Change-Id: Ia2d1f402ffa5a46e2bfb5367ba79890f8b8d3cc8

bcmdhd.1.579.77.41.1.cn/dhd_linux.c

index 0264224a271d97adaa6f9abb028368d5fe141140..9d769fe556d463077c39dc35ec4b35fb53aacb86 100644 (file)
@@ -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