Commit cf3f15b
mmc: sunplus: Fix error handling in spmmc_drv_probe()
When mmc allocation succeeds, the error paths are not freeing mmc.
Fix the above issue by changing mmc_alloc_host() to devm_mmc_alloc_host()
to simplify the error handling. Remove label 'probe_free_host' as devm_*
api takes care of freeing, also remove mmc_free_host() from remove
function as devm_* takes care of freeing.
Fixes: 4e268fe ("mmc: Add mmc driver for Sunplus SP7021")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/all/a3829ed3-d827-4b9d-827e-9cc24a3ec3bc@moroto.mountain/
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20230809071812.547229-1-harshit.m.mogalapalli@oracle.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>1 parent dce6d8f commit cf3f15b
1 file changed
Lines changed: 3 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
863 | 863 | | |
864 | 864 | | |
865 | 865 | | |
866 | | - | |
867 | | - | |
868 | | - | |
869 | | - | |
870 | | - | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
871 | 869 | | |
872 | 870 | | |
873 | 871 | | |
| |||
938 | 936 | | |
939 | 937 | | |
940 | 938 | | |
941 | | - | |
942 | | - | |
943 | | - | |
944 | | - | |
945 | | - | |
946 | 939 | | |
947 | 940 | | |
948 | 941 | | |
| |||
956 | 949 | | |
957 | 950 | | |
958 | 951 | | |
959 | | - | |
960 | 952 | | |
961 | 953 | | |
962 | 954 | | |
| |||
0 commit comments