diff options
author | Diana Craciun <diana.craciun@oss.nxp.com> | 2020-09-29 11:54:38 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-10-02 16:05:01 +0200 |
commit | 5026cf605143e764e1785bbf9158559d17f8d260 (patch) | |
tree | 573c59382031024a249a10e6713c3708b62ef593 /drivers/bus/fsl-mc | |
parent | 17eaf21320da965c2571a5f029a2becaffe8313f (diff) | |
download | linux-stable-5026cf605143e764e1785bbf9158559d17f8d260.tar.gz linux-stable-5026cf605143e764e1785bbf9158559d17f8d260.tar.bz2 linux-stable-5026cf605143e764e1785bbf9158559d17f8d260.zip |
bus/fsl_mc: Do not rely on caller to provide non NULL mc_io
Before destroying the mc_io, check first that it was
allocated.
Reviewed-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Diana Craciun <diana.craciun@oss.nxp.com>
Link: https://lore.kernel.org/r/20200929085441.17448-11-diana.craciun@oss.nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/bus/fsl-mc')
-rw-r--r-- | drivers/bus/fsl-mc/mc-io.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/bus/fsl-mc/mc-io.c b/drivers/bus/fsl-mc/mc-io.c index a30b53f1d87d..305015486b91 100644 --- a/drivers/bus/fsl-mc/mc-io.c +++ b/drivers/bus/fsl-mc/mc-io.c @@ -129,7 +129,12 @@ error_destroy_mc_io: */ void fsl_destroy_mc_io(struct fsl_mc_io *mc_io) { - struct fsl_mc_device *dpmcp_dev = mc_io->dpmcp_dev; + struct fsl_mc_device *dpmcp_dev; + + if (!mc_io) + return; + + dpmcp_dev = mc_io->dpmcp_dev; if (dpmcp_dev) fsl_mc_io_unset_dpmcp(mc_io); |