mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 14:19:09 -04:00
rtl8xxxu: Check return value of kmemdup()
In rtl8xxxu_load_firmware() check the return value of kmemdup() and error out with -ENOMEM in case of NULL to prevent a NULL pointer dereference. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
parent
c1edece3c2
commit
98e27cbd94
1 changed files with 4 additions and 0 deletions
|
|
@ -2197,6 +2197,10 @@ static int rtl8xxxu_load_firmware(struct rtl8xxxu_priv *priv, char *fw_name)
|
|||
}
|
||||
|
||||
priv->fw_data = kmemdup(fw->data, fw->size, GFP_KERNEL);
|
||||
if (!priv->fw_data) {
|
||||
ret = -ENOMEM;
|
||||
goto exit;
|
||||
}
|
||||
priv->fw_size = fw->size - sizeof(struct rtl8xxxu_firmware_header);
|
||||
|
||||
signature = le16_to_cpu(priv->fw_data->signature);
|
||||
|
|
|
|||
Loading…
Reference in a new issue