summaryrefslogtreecommitdiff
path: root/drivers/net/usb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/usb')
-rw-r--r--drivers/net/usb/r8152.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index d3c30ccc8577..283b35a76cf0 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -4000,8 +4000,8 @@ static void rtl8152_fw_mac_apply(struct r8152 *tp, struct fw_mac *mac)
static void rtl8152_apply_firmware(struct r8152 *tp)
{
struct rtl_fw *rtl_fw = &tp->rtl_fw;
- const struct firmware *fw = rtl_fw->fw;
- struct fw_header *fw_hdr = (struct fw_header *)fw->data;
+ const struct firmware *fw;
+ struct fw_header *fw_hdr;
struct fw_phy_patch_key *key;
u16 key_addr = 0;
int i;
@@ -4009,6 +4009,9 @@ static void rtl8152_apply_firmware(struct r8152 *tp)
if (IS_ERR_OR_NULL(rtl_fw->fw))
return;
+ fw = rtl_fw->fw;
+ fw_hdr = (struct fw_header *)fw->data;
+
if (rtl_fw->pre_fw)
rtl_fw->pre_fw(tp);