mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-28 21:33:52 +00:00
bus/fsl_mc: Do not rely on caller to provide non NULL mc_io
[ Upstream commit 5026cf6051
]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
a42d588fbd
commit
ac4998bbf8
1 changed files with 6 additions and 1 deletions
|
@ -167,7 +167,12 @@ int __must_check fsl_create_mc_io(struct device *dev,
|
||||||
*/
|
*/
|
||||||
void fsl_destroy_mc_io(struct fsl_mc_io *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)
|
if (dpmcp_dev)
|
||||||
fsl_mc_io_unset_dpmcp(mc_io);
|
fsl_mc_io_unset_dpmcp(mc_io);
|
||||||
|
|
Loading…
Reference in a new issue