2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-15 16:53:54 +08:00

pcmcia/electra_cf: Fix some return values in 'electra_cf_probe()' in case of error

'status' is known to be 0 at this point. It must be set to a meaningful
value in order to return an error code if one of the 'of_get_property()'
call fails.

Return -EINVAL in such a case.

Fixes: 2b571a066a2f("pcmcia: CompactFlash driver for PA Semi Electra boards")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
This commit is contained in:
Christophe JAILLET 2020-06-17 21:53:26 +02:00 committed by Dominik Brodowski
parent b3298500b2
commit f15480e947

View File

@ -229,6 +229,8 @@ static int electra_cf_probe(struct platform_device *ofdev)
cf->socket.pci_irq = cf->irq;
status = -EINVAL;
prop = of_get_property(np, "card-detect-gpio", NULL);
if (!prop)
goto fail1;