mirror of
https://github.com/torvalds/linux.git
synced 2026-05-12 16:18:45 +02:00
net: wan: fsl_ucc_hdlc: fix ucc_hdlc_remove
If the driver is used in a non tdm mode priv->utdm is a NULL pointer.
Therefore we need to check this pointer first before checking si_regs.
Fixes: c19b6d246a ("drivers/net: support hdlc function for QE-UCC")
Signed-off-by: Holger Brunck <holger.brunck@hitachienergy.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
1a57efe250
commit
851bba8068
|
|
@ -1250,12 +1250,12 @@ static void ucc_hdlc_remove(struct platform_device *pdev)
|
|||
|
||||
uhdlc_memclean(priv);
|
||||
|
||||
if (priv->utdm->si_regs) {
|
||||
if (priv->utdm && priv->utdm->si_regs) {
|
||||
iounmap(priv->utdm->si_regs);
|
||||
priv->utdm->si_regs = NULL;
|
||||
}
|
||||
|
||||
if (priv->utdm->siram) {
|
||||
if (priv->utdm && priv->utdm->siram) {
|
||||
iounmap(priv->utdm->siram);
|
||||
priv->utdm->siram = NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user