Re: [PATCH] mcb: fix error handling for different scenarios when parsing

From: Yang Yingliang
Date: Wed Sep 06 2023 - 21:32:15 EST



On 2023/9/6 22:36, Sanjuán García, Jorge wrote:
chameleon_parse_gdd() may fail for different reasons and end up
in the err tag. Make sure we at least make sure we always free
the mcb_device allocated with mcb_alloc_dev().

If mcb_device_register() fails, make sure to give up the reference
in the same place the device was added.

Fixes: 728ac3389296 ("mcb: mcb-parse: fix error handing in chameleon_parse_gdd()")
Reviewed-by: Jose Javier Rodriguez Barbarin <JoseJavier.Rodriguez@xxxxxxxxxx>
Signed-off-by: Jorge Sanjuan Garcia <jorge.sanjuangarcia@xxxxxxxxxx>
Reviewed-by: Yang Yingliang <yangyingliang@xxxxxxxxxx>