Re: [PATCH 1/3] IB/srp: allocate ib_qp_attr on the stack

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





Since kzmalloc was not used this patch do the job it intend to do.
Do you think, while-we-are-there that it will be safer to use memset before
using the object?


You're safe because of the flags you pass to ib_modify_qp, but we can add it.
Bart, what do you think ?

+	attr.qp_access_flags = (IB_ACCESS_REMOTE_READ |
 				    IB_ACCESS_REMOTE_WRITE);
-	attr->port_num        = target->srp_host->port;
+	attr.port_num        = target->srp_host->port;

-	ret = ib_modify_qp(qp, attr,
+	ret = ib_modify_qp(qp, &attr,
 			   IB_QP_STATE		|
 			   IB_QP_PKEY_INDEX	|
 			   IB_QP_ACCESS_FLAGS	|
 			   IB_QP_PORT);

 out:
-	kfree(attr);
 	return ret;
 }

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux