Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1423111AbWLUVWI (ORCPT ); Thu, 21 Dec 2006 16:22:08 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1423113AbWLUVWI (ORCPT ); Thu, 21 Dec 2006 16:22:08 -0500 Received: from mtagate3.de.ibm.com ([195.212.29.152]:49813 "EHLO mtagate3.de.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1423111AbWLUVWG (ORCPT ); Thu, 21 Dec 2006 16:22:06 -0500 Date: Thu, 21 Dec 2006 22:22:02 +0100 From: Heiko Carstens To: Akinobu Mita , linux-kernel@vger.kernel.org, Hoang-Nam Nguyen , Christoph Raisch Subject: Re: [PATCH] ehca: fix kthread_create() error check Message-ID: <20061221212202.GA23157@osiris.ibm.com> References: <20061219084248.GF4049@APFDCB5C> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20061219084248.GF4049@APFDCB5C> User-Agent: mutt-ng/devel-r804 (Linux) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1405 Lines: 40 > Index: 2.6-mm/drivers/infiniband/hw/ehca/ehca_irq.c > =================================================================== > --- 2.6-mm.orig/drivers/infiniband/hw/ehca/ehca_irq.c > +++ 2.6-mm/drivers/infiniband/hw/ehca/ehca_irq.c > @@ -670,11 +670,13 @@ static int comp_pool_callback(struct not > { > unsigned int cpu = (unsigned long)hcpu; > struct ehca_cpu_comp_task *cct; > + struct task_struct *task; > > switch (action) { > case CPU_UP_PREPARE: > ehca_gen_dbg("CPU: %x (CPU_PREPARE)", cpu); > - if(!create_comp_task(pool, cpu)) { > + task = create_comp_task(pool, cpu); > + if (IS_ERR(task)) { > ehca_gen_err("Can't create comp_task for cpu: %x", cpu); > return NOTIFY_BAD; > } If this fails then the code will crash on CPU_UP_CANCELED. Because of kthread_bind(cct->task,...). cct->task would be just the encoded error number. > @@ -730,7 +732,7 @@ int ehca_create_comp_pool(void) > > for_each_online_cpu(cpu) { > task = create_comp_task(pool, cpu); > - if (task) { > + if (!IS_ERR(task)) { > kthread_bind(task, cpu); > wake_up_process(task); > } So you silently ignore errors and the module loads anyway? - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/