Author: slavash
Date: Wed Dec  5 13:48:10 2018
New Revision: 341569
URL: https://svnweb.freebsd.org/changeset/base/341569

Log:
  mlx5ib: Fix null pointer dereference in mlx5_ib_create_srq
  
  Although "create_srq_user" does overwrite "in.pas" on some paths, it
  also contains at least one feasible path which does not overwrite it.
  
  Approved by:    hselasky (mentor)
  MFC after:      1 week
  Sponsored by:   Mellanox Technologies

Modified:
  head/sys/dev/mlx5/mlx5_ib/mlx5_ib_srq.c

Modified: head/sys/dev/mlx5/mlx5_ib/mlx5_ib_srq.c
==============================================================================
--- head/sys/dev/mlx5/mlx5_ib/mlx5_ib_srq.c     Wed Dec  5 13:47:41 2018        
(r341568)
+++ head/sys/dev/mlx5/mlx5_ib/mlx5_ib_srq.c     Wed Dec  5 13:48:10 2018        
(r341569)
@@ -287,7 +287,7 @@ struct ib_srq *mlx5_ib_create_srq(struct ib_pd *pd,
        else
                err = create_srq_kernel(dev, srq, &in, buf_size);
 
-       if (err) {
+       if (err || !in.pas) {
                mlx5_ib_warn(dev, "create srq %s failed, err %d\n",
                             pd->uobject ? "user" : "kernel", err);
                goto err_srq;
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to