From 8accf4e6193840c2b9f0dd524f5c88c2e08b52c7 Mon Sep 17 00:00:00 2001 From: Rongjun Chen Date: Fri, 14 Dec 2018 16:04:27 +0800 Subject: [PATCH] wifi: optimize 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: I9f15fe6badb709448c53731fc97d74364a13bd03 Signed-off-by: Rongjun Chen --- bcmdhd.1.579.77.41.1.cn/dbus.c | 2 ++ bcmdhd.1.579.77.41.1.cn/dhd_linux.c | 6 ++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bcmdhd.1.579.77.41.1.cn/dbus.c b/bcmdhd.1.579.77.41.1.cn/dbus.c index 1f040e7..7c77bbe 100644 --- a/bcmdhd.1.579.77.41.1.cn/dbus.c +++ b/bcmdhd.1.579.77.41.1.cn/dbus.c @@ -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) { 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 9d769fe..0264224 100644 --- a/bcmdhd.1.579.77.41.1.cn/dhd_linux.c +++ b/bcmdhd.1.579.77.41.1.cn/dhd_linux.c @@ -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 -- 2.20.1