[PATCH] pcmcia: pcmcia_resource: return 0 if success

From: Jason Wang
Date: Sun Dec 12 2021 - 03:00:11 EST


The initial value of variable `ret' is -EINVAL, which is used for
returning the error status in `pcmcia_release_io' when errors occur.
But if there is no error in `pcmcia_release_io', `ret' should be changed
to a successful value to return. Thus we change `ret' value to 0 when
the function's status is successful.

Signed-off-by: Jason Wang <wangborong@xxxxxxxxxx>
---
drivers/pcmcia/pcmcia_resource.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index c1c197292111..257181cb686f 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -409,6 +409,7 @@ static int pcmcia_release_io(struct pcmcia_device *p_dev)

p_dev->_io = 0;
c->state &= ~CONFIG_IO_REQ;
+ ret = 0;

out:
mutex_unlock(&s->ops_mutex);
--
2.34.1