Message ID | 1513726549-7065-2-git-send-email-shannon.nelson@oracle.com |
---|---|
State | Awaiting Upstream, archived |
Delegated to: | David Miller |
Headers | show |
Series | xfrm: offload api fixes | expand |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index e015e16..dfabd04 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -1891,7 +1891,8 @@ static inline void xfrm_dev_state_free(struct xfrm_state *x) struct net_device *dev = xso->dev; if (dev && dev->xfrmdev_ops) { - dev->xfrmdev_ops->xdo_dev_state_free(x); + if (dev->xfrmdev_ops->xdo_dev_state_free) + dev->xfrmdev_ops->xdo_dev_state_free(x); xso->dev = NULL; dev_put(dev); }
The current XFRM code assumes that we've implemented the xdo_dev_state_free() callback, even if it is meaningless to the driver. This patch adds a check for it before calling, as done in other APIs, to prevent a NULL function pointer kernel crash. Signed-off-by: Shannon Nelson <shannon.nelson@oracle.com> --- include/net/xfrm.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)