ionic: catch failure from devlink_alloc
Add a check for NULL on the alloc return. If devlink_alloc() fails and we try to use devlink_priv() on the NULL return, the kernel gets very unhappy and panics. With this fix, the driver load will still fail, but at least it won't panic the kernel. Fixes: df69ba43 ("ionic: Add basic framework for IONIC Network device driver") Signed-off-by: NShannon Nelson <shannon.nelson@amd.com> Reviewed-by: NSimon Horman <simon.horman@corigine.com> Reviewed-by: NJiri Pirko <jiri@nvidia.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Showing
想要评论请 注册 或 登录