Skip to contentSkip to conversation

memstick: core: fix error return code of mspro_block_resume()

PATCH In review Jia-Ju Bai 2 participants 2 messages Mar 5, 2021 – Mar 9, 2021

Subsystems (2)
lore
Share & tools
lore

Jia-Ju Bai

author
#0 lore raw

PATCH 1/1 memstick: core: fix error return code of mspro_block_resume()

When mspro_block_init_card() fails, no error return code of mspro_block_resume() is assigned.
To fix this bug, rc is assigned with the return value of mspro_block_init_card(), and then rc is checked.

---
 drivers/memstick/core/mspro_block.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/memstick/core/mspro_block.c +2 -1
index afb892e7ffc6..cf7fe0d58ee7 100644
@@ -1382,7 +1382,8 @@ static int mspro_block_resume(struct memstick_dev *card)
 
 	new_msb->card = card;
 	memstick_set_drvdata(card, new_msb);
-	if (mspro_block_init_card(card))
+	rc = mspro_block_init_card(card);
+	if (rc)
 		goto out_free;
 
 	for (cnt = 0; new_msb->attr_group.attrs[cnt]
Signature · 1 line
2.17.1
#1 lore raw
Quoted 8 lines · Jia-Ju Bai

When mspro_block_init_card() fails, no error return code of mspro_block_resume() is assigned.
To fix this bug, rc is assigned with the return value of mspro_block_init_card(), and then rc is checked.

Applied for next, thanks!

Kind regards
Uffe

Quoted 21 lines
---
 drivers/memstick/core/mspro_block.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/memstick/core/mspro_block.c +2 -2
index afb892e7ffc6..cf7fe0d58ee7 100644
@@ -1382,7 +1382,8 @@ static int mspro_block_resume(struct memstick_dev *card)
 
        new_msb->card = card;
        memstick_set_drvdata(card, new_msb);
-       if (mspro_block_init_card(card))
+       rc = mspro_block_init_card(card);
+       if (rc)
                goto out_free;
 
        for (cnt = 0; new_msb->attr_group.attrs[cnt]
--

2.17.1