forked from Imagelibrary/rtems
grspw_pkt.c: Fix Dereference before null check (CID #1399846)
CID 1399846: Dereference before null check in grspw_addr_ctrl(). Closes #4253
This commit is contained in:
@@ -655,7 +655,7 @@ void grspw_hw_support(void *d, struct grspw_hw_sup *hw)
|
||||
void grspw_addr_ctrl(void *d, struct grspw_addr_config *cfg)
|
||||
{
|
||||
struct grspw_priv *priv = d;
|
||||
struct grspw_regs *regs = priv->regs;
|
||||
struct grspw_regs *regs;
|
||||
unsigned int ctrl, nodeaddr;
|
||||
SPIN_IRQFLAGS(irqflags);
|
||||
int i;
|
||||
@@ -663,6 +663,8 @@ void grspw_addr_ctrl(void *d, struct grspw_addr_config *cfg)
|
||||
if (!priv || !cfg)
|
||||
return;
|
||||
|
||||
regs = priv->regs;
|
||||
|
||||
SPIN_LOCK_IRQ(&priv->devlock, irqflags);
|
||||
|
||||
if (cfg->promiscuous != -1) {
|
||||
|
||||
Reference in New Issue
Block a user