Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 58fee00f authored by Yuval Mintz's avatar Yuval Mintz Committed by David S. Miller
Browse files

bnx2x: Make BP_VF more robust



Prevent dereference of pointer in case it's NULL.

Signed-off-by: default avatarYuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: default avatarAriel Elior <Ariel.Elior@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a345ce71
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -299,7 +299,8 @@ struct bnx2x_vfdb {
#define BP_VFDB(bp)		((bp)->vfdb)
	/* vf array */
	struct bnx2x_virtf	*vfs;
#define BP_VF(bp, idx)		(&((bp)->vfdb->vfs[idx]))
#define BP_VF(bp, idx)		((BP_VFDB(bp) && (bp)->vfdb->vfs) ? \
					&((bp)->vfdb->vfs[idx]) : NULL)
#define bnx2x_vf(bp, idx, var)	((bp)->vfdb->vfs[idx].var)

	/* queue array - for all vfs */