Commit 240b74fd authored by Jakub Kicinski's avatar Jakub Kicinski Committed by Daniel Borkmann

nfp: fix variable dereferenced before check in nfp_app_ctrl_rx_raw()

'app' is dereferenced before used for the devlink trace point.
In case FW is buggy and sends a control message to a VF queue
we should make sure app is not NULL.
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: default avatarDirk van der Merwe <dirk.vandermerwe@netronome.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
parent 1f821611
......@@ -392,10 +392,11 @@ static inline void nfp_app_ctrl_rx(struct nfp_app *app, struct sk_buff *skb)
static inline void
nfp_app_ctrl_rx_raw(struct nfp_app *app, const void *data, unsigned int len)
{
trace_devlink_hwmsg(priv_to_devlink(app->pf), true, 0, data, len);
if (!app || !app->type->ctrl_msg_rx_raw)
return;
if (app && app->type->ctrl_msg_rx_raw)
app->type->ctrl_msg_rx_raw(app, data, len);
trace_devlink_hwmsg(priv_to_devlink(app->pf), true, 0, data, len);
app->type->ctrl_msg_rx_raw(app, data, len);
}
static inline int nfp_app_eswitch_mode_get(struct nfp_app *app, u16 *mode)
......
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