From patchwork Fri Jun 17 17:34:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: weiyj_lk@163.com X-Patchwork-Id: 9184715 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 47232608A2 for ; Fri, 17 Jun 2016 17:35:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2CDB0282EE for ; Fri, 17 Jun 2016 17:35:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 213EA28385; Fri, 17 Jun 2016 17:35:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A214B282EE for ; Fri, 17 Jun 2016 17:35:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933135AbcFQRfQ (ORCPT ); Fri, 17 Jun 2016 13:35:16 -0400 Received: from m12-16.163.com ([220.181.12.16]:53764 "EHLO m12-16.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933120AbcFQRfN (ORCPT ); Fri, 17 Jun 2016 13:35:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=WgHKN zwjfZR/QE5sp2IpkDX6MKmM+MFTjEiZCyN92Pk=; b=M7QyO6KNGmNCmtmco1Fbt OayevwxpclqZuClniRcQzJF68PtVsLsWiM04SbfSM/T7TmpldunsuZI1VBtQXGnG 3xmBsg+Acrm8jbYPIMhZLCCD3LFqSqJyAIzxJLVidVlGZ5UgXX1SnmYCAePRAf0/ yMZBUBn0ldg6Zgv6Z9OHYs= Received: from localhost.localdomain.localdomain (unknown [117.36.101.242]) by smtp12 (Coremail) with SMTP id EMCowADH59eaNGRX3EuCBA--.14017S3; Sat, 18 Jun 2016 01:34:18 +0800 (CST) From: weiyj_lk@163.com To: Johnny Kim , Austin Shin , Chris Park , Tony Cho , Glen Lee , Leo Kim , Greg Kroah-Hartman Cc: Wei Yongjun , linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org Subject: [PATCH] staging: wilc1000: fix return value check in wlan_initialize_threads() Date: Fri, 17 Jun 2016 17:34:17 +0000 Message-Id: <1466184857-21605-1-git-send-email-weiyj_lk@163.com> X-Mailer: git-send-email 2.5.5 MIME-Version: 1.0 X-CM-TRANSID: EMCowADH59eaNGRX3EuCBA--.14017S3 X-Coremail-Antispam: 1Uf129KBjvdXoW7WryUGFW7ur43CF13tF13urg_yoWDuFc_Cw 4av3W7JFyq9as2q3yjkry5Ar9xJFnrZr4xXw48try3Jr47CrZ3W390vr1DJw43GrWDCrZr Cr4xZr1SkrZrGjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUeOJ57UUUUU== X-Originating-IP: [117.36.101.242] X-CM-SenderInfo: pzhl5yxbonqiywtou0bp/1tbioxqL1lUL623ARQAAs5 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun In case of error, the function kthread_run() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Signed-off-by: Wei Yongjun Reviewed-by: Julian Calaby --- drivers/staging/wilc1000/linux_wlan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 4f93c11..b622510 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -717,10 +717,10 @@ static int wlan_initialize_threads(struct net_device *dev) wilc->txq_thread = kthread_run(linux_wlan_txq_task, (void *)dev, "K_TXQ_TASK"); - if (!wilc->txq_thread) { + if (IS_ERR(wilc->txq_thread)) { netdev_err(dev, "couldn't create TXQ thread\n"); wilc->close = 0; - return -ENOBUFS; + return PTR_ERR(wilc->txq_thread); } wait_for_completion(&wilc->txq_thread_started);