@@ -149,16 +149,16 @@ int xc_request_firmware(struct xc *x)
x->type = head->type;
x->version = head->version;
- ret = -EINVAL;
-
for (i = 0; i < 3; i++) {
src = fw->data + head->fw_desc[i].ofs;
dst = *(unsigned int *)src;
src += sizeof (unsigned int);
size = head->fw_desc[i].size - sizeof (unsigned int);
- if (xc_check_ptr(x, dst, size))
+ if (xc_check_ptr(x, dst, size)) {
+ ret = -EINVAL;
goto exit_release_firmware;
+ }
memcpy((void *)io_p2v(dst), src, size);
@@ -169,8 +169,6 @@ int xc_request_firmware(struct xc *x)
goto exit_release_firmware;
}
- ret = 0;
-
exit_release_firmware:
release_firmware(fw);