mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-05-04 22:34:16 +00:00
xfrm: check for xdo_dev_state_free
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> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
This commit is contained in:
parent
f58869c44f
commit
7f05b467a7
1 changed files with 2 additions and 1 deletions
|
@ -1933,7 +1933,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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue