Commit 8c57a3a7 authored by xypron.glpk@gmx.de's avatar xypron.glpk@gmx.de Committed by David S. Miller

wan/fsl_ucc_hdlc: avoid possible NULL pointer dereference

All assignments to components of priv should only
occur after the check if prif is NULL.
Signed-off-by: default avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4fb482f7
...@@ -862,7 +862,7 @@ static int uhdlc_suspend(struct device *dev) ...@@ -862,7 +862,7 @@ static int uhdlc_suspend(struct device *dev)
static int uhdlc_resume(struct device *dev) static int uhdlc_resume(struct device *dev)
{ {
struct ucc_hdlc_private *priv = dev_get_drvdata(dev); struct ucc_hdlc_private *priv = dev_get_drvdata(dev);
struct ucc_tdm *utdm = priv->utdm; struct ucc_tdm *utdm;
struct ucc_tdm_info *ut_info; struct ucc_tdm_info *ut_info;
struct ucc_fast __iomem *uf_regs; struct ucc_fast __iomem *uf_regs;
struct ucc_fast_private *uccf; struct ucc_fast_private *uccf;
...@@ -877,6 +877,7 @@ static int uhdlc_resume(struct device *dev) ...@@ -877,6 +877,7 @@ static int uhdlc_resume(struct device *dev)
if (!netif_running(priv->ndev)) if (!netif_running(priv->ndev))
return 0; return 0;
utdm = priv->utdm;
ut_info = priv->ut_info; ut_info = priv->ut_info;
uf_info = &ut_info->uf_info; uf_info = &ut_info->uf_info;
uf_regs = priv->uf_regs; uf_regs = priv->uf_regs;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment