aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorMiquel Raynal <miquel.raynal@bootlin.com>2021-12-31 13:28:36 +0100
committerMiquel Raynal <miquel.raynal@bootlin.com>2021-12-31 13:28:47 +0100
commit2dc6de1cd303bf9298eee4b4ad4bbe911e8a8a1d (patch)
tree67a019e547e509d64798e697a5b511b758cb930d /drivers/mtd
parentmtdchar: prevent unbounded allocation in MEMWRITE ioctl (diff)
parentmtd: hyperbus: rpc-if: fix bug in rpcif_hb_remove (diff)
downloadlinux-dev-2dc6de1cd303bf9298eee4b4ad4bbe911e8a8a1d.tar.xz
linux-dev-2dc6de1cd303bf9298eee4b4ad4bbe911e8a8a1d.zip
Merge tag 'cfi/for-5.17' into mtd/next
Hyperbus changes for v5.17-rc1 Hyperbus changes: Couple of fixes in Renesas hyperbus rpc-if driver to avoid crash on module remove and for missing check for error value in probe. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/hyperbus/rpc-if.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/mtd/hyperbus/rpc-if.c b/drivers/mtd/hyperbus/rpc-if.c
index ecb050ba95cd..dc164c18f842 100644
--- a/drivers/mtd/hyperbus/rpc-if.c
+++ b/drivers/mtd/hyperbus/rpc-if.c
@@ -124,7 +124,9 @@ static int rpcif_hb_probe(struct platform_device *pdev)
if (!hyperbus)
return -ENOMEM;
- rpcif_sw_init(&hyperbus->rpc, pdev->dev.parent);
+ error = rpcif_sw_init(&hyperbus->rpc, pdev->dev.parent);
+ if (error)
+ return error;
platform_set_drvdata(pdev, hyperbus);
@@ -150,9 +152,9 @@ static int rpcif_hb_remove(struct platform_device *pdev)
{
struct rpcif_hyperbus *hyperbus = platform_get_drvdata(pdev);
int error = hyperbus_unregister_device(&hyperbus->hbdev);
- struct rpcif *rpc = dev_get_drvdata(pdev->dev.parent);
- rpcif_disable_rpm(rpc);
+ rpcif_disable_rpm(&hyperbus->rpc);
+
return error;
}