提交 1b5135d9 编写于 作者: T Thomas Klein 提交者: Jeff Garzik

[PATCH] ehea: Nullpointer dereferencation fix

Fix: Must check for nullpointer before dereferencing it - not afterwards.
Signed-off-by: NThomas Klein <tklein@de.ibm.com>
Signed-off-by: NJeff Garzik <jeff@garzik.org>
上级 d1ed6a3e
...@@ -209,11 +209,11 @@ int ehea_destroy_cq(struct ehea_cq *cq) ...@@ -209,11 +209,11 @@ int ehea_destroy_cq(struct ehea_cq *cq)
{ {
u64 adapter_handle, hret; u64 adapter_handle, hret;
adapter_handle = cq->adapter->handle;
if (!cq) if (!cq)
return 0; return 0;
adapter_handle = cq->adapter->handle;
/* deregister all previous registered pages */ /* deregister all previous registered pages */
hret = ehea_h_free_resource(adapter_handle, cq->fw_handle); hret = ehea_h_free_resource(adapter_handle, cq->fw_handle);
if (hret != H_SUCCESS) { if (hret != H_SUCCESS) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册