wifi: optimize fix r311 wifi panic issue [1/1]
authorRongjun Chen <rongjun.chen@amlogic.com>
Fri, 14 Dec 2018 08:04:27 +0000 (16:04 +0800)
committerRongjun Chen <rongjun.chen@amlogic.com>
Fri, 14 Dec 2018 08:08:46 +0000 (16:08 +0800)
PD#SWPL-3107

Problem:
r311 autoreboot wifi panic

Solution:
fix the null pointer issue

Verify:
r311

Change-Id: I9f15fe6badb709448c53731fc97d74364a13bd03
Signed-off-by: Rongjun Chen <rongjun.chen@amlogic.com>
bcmdhd.1.579.77.41.1.cn/dbus.c
bcmdhd.1.579.77.41.1.cn/dhd_linux.c

index 1f040e72669c31da7b0dcc6dea42af8dfd4e8fd3..7c77bbe51f0231ef21e333ded51c076a47cdb98c 100644 (file)
@@ -647,6 +647,8 @@ dbus_get_fw_nvram(dhd_bus_t *dhd_bus, char *pfw_path, char *pnv_path)
        if (nv_image)
                dhd_os_close_image(nv_image);
 
+       nv_image = NULL;
+
        /* For Get first block of fw to calculate total_len */
        file_exists = ((pfw_path != NULL) && (pfw_path[0] != '\0'));
        if (file_exists) {
index 9d769fe556d463077c39dc35ec4b35fb53aacb86..0264224a271d97adaa6f9abb028368d5fe141140 100644 (file)
@@ -13826,10 +13826,8 @@ err:
 void
 dhd_os_close_image(void *image)
 {
-       struct file *filp = image;
-
-       if (filp && filp->f_op)
-               filp_close(filp, NULL);
+       if (image)
+               filp_close((struct file *)image, NULL);
 }
 
 void