mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
nfc: s3fwrn5: Release the nfc firmware
[ Upstream commit a4485baefa1efa596702ebffd5a9c760d42b14b5 ]
add the code to release the nfc firmware when the firmware image size is
wrong.
Fixes: c04c674fad ("nfc: s3fwrn5: Add driver for Samsung S3FWRN5 NFC Chip")
Signed-off-by: Bongsu Jeon <[email protected]>
Reviewed-by: Krzysztof Kozlowski <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
parent
7a3d6a5dfc
commit
d864e7e827
1 changed files with 3 additions and 1 deletions
|
|
@ -293,8 +293,10 @@ static int s3fwrn5_fw_request_firmware(struct s3fwrn5_fw_info *fw_info)
|
|||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (fw->fw->size < S3FWRN5_FW_IMAGE_HEADER_SIZE)
|
||||
if (fw->fw->size < S3FWRN5_FW_IMAGE_HEADER_SIZE) {
|
||||
release_firmware(fw->fw);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
memcpy(fw->date, fw->fw->data + 0x00, 12);
|
||||
fw->date[12] = '\0';
|
||||
|
|
|
|||
Loading…
Reference in a new issue