Skip to content

Commit

Permalink
pcmcia/electra_cf: Fix some return values in 'electra_cf_probe()' in …
Browse files Browse the repository at this point in the history
…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: 2b571a0("pcmcia: CompactFlash driver for PA Semi Electra boards")
Signed-off-by: Christophe JAILLET <[email protected]>
Acked-by: Olof Johansson <[email protected]>
Signed-off-by: Dominik Brodowski <[email protected]>
  • Loading branch information
tititiou36 authored and Dominik Brodowski committed Dec 5, 2020
1 parent b329850 commit f15480e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/pcmcia/electra_cf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f15480e

Please sign in to comment.