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 <[email protected]>
Closes: https://lore.kernel.org/all/[email protected]/
Signed-off-by: Harshit Mogalapalli <[email protected]>
Reviewed-by: Dan Carpenter <[email protected]>
Cc: [email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Ulf Hansson <[email protected]>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