diff options
author | Daniel Baluta <daniel.baluta@nxp.com> | 2018-11-08 16:02:40 +0200 |
---|---|---|
committer | Dong Aisheng <aisheng.dong@nxp.com> | 2019-11-25 15:52:12 +0800 |
commit | 13bc9cfb13def83d394bb6ca7a8fbcdbf0f00f44 (patch) | |
tree | 7c131d9376b5aefa795de5e4c31e75bc325d2d26 /sound/soc/fsl/fsl_dsp_library_load.c | |
parent | a314e4fe32a16ca94484c596b1370e40453ec1ae (diff) |
MLK-20189-4: ASoC: fsl: library_load: Check return value for kernel_read
Bail out if kernel_read returns an error.
Fixes: CID1477415
Reviewed-by: S.j. Wang <shengjiu.wang@nxp.com>
Reviewed-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Diffstat (limited to 'sound/soc/fsl/fsl_dsp_library_load.c')
-rw-r--r-- | sound/soc/fsl/fsl_dsp_library_load.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sound/soc/fsl/fsl_dsp_library_load.c b/sound/soc/fsl/fsl_dsp_library_load.c index 11bb9396ab4d..d273f7296e29 100644 --- a/sound/soc/fsl/fsl_dsp_library_load.c +++ b/sound/soc/fsl/fsl_dsp_library_load.c @@ -484,7 +484,9 @@ load_dpu_with_library(struct xf_client *client, struct xf_proxy *proxy, return -ENOMEM; vfs_llseek(file, 0, SEEK_SET); - kernel_read(file, srambuf, filesize, &pos); + ret_val = kernel_read(file, srambuf, filesize, &pos); + if (ret_val < 0) + return ret_val; filp_close(file, NULL); ret_val = xtlib_split_pi_library_size( |