From: Rongjun Chen Date: Fri, 14 Dec 2018 08:04:27 +0000 (+0800) Subject: wifi: optimize fix r311 wifi panic issue [1/1] X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8accf4e6193840c2b9f0dd524f5c88c2e08b52c7;p=GitHub%2FLineageOS%2FG12%2Fandroid_hardware_amlogic_kernel-modules_dhd-driver.git 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 --- 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