From: Thomas Klein Date: Fri, 3 Nov 2006 16:47:20 +0000 (+0100) Subject: [PATCH] ehea: Nullpointer dereferencation fix X-Git-Tag: v2.6.19-rc5~10^2~4 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1b5135d9b922fdcf46e1e7383167d93d42635fb4;p=linux-2.6 [PATCH] ehea: Nullpointer dereferencation fix Fix: Must check for nullpointer before dereferencing it - not afterwards. Signed-off-by: Thomas Klein Signed-off-by: Jeff Garzik --- diff --git a/drivers/net/ehea/ehea_qmr.c b/drivers/net/ehea/ehea_qmr.c index 3e1862326c..161559315c 100644 --- a/drivers/net/ehea/ehea_qmr.c +++ b/drivers/net/ehea/ehea_qmr.c @@ -209,11 +209,11 @@ int ehea_destroy_cq(struct ehea_cq *cq) { u64 adapter_handle, hret; - adapter_handle = cq->adapter->handle; - if (!cq) return 0; + adapter_handle = cq->adapter->handle; + /* deregister all previous registered pages */ hret = ehea_h_free_resource(adapter_handle, cq->fw_handle); if (hret != H_SUCCESS) {