in function init_exfat(exfat,bs),if it fails to calloc memory,it will call function free_exfat and return -ENOMEM. Thus it will goto err in main function and call free_exfat(exfat) again.
As follows:
main
->init_exfat(exfat,bs)
->free_exfat(exfat)
return -ENOMEM
->free_exfat(exfat)
Let exfat = NULL if we failed to init exfat.
in function init_exfat(exfat,bs),if it fails to calloc memory,it will call function free_exfat and return -ENOMEM. Thus it will goto err in main function and call free_exfat(exfat) again. As follows: main ->init_exfat(exfat,bs) ->free_exfat(exfat) return -ENOMEM ->free_exfat(exfat) Let exfat = NULL if we failed to init exfat.
Signed-off-by: yijiangqiu1 wangfangli@xiaomi.com