From patchwork Fri Oct 25 09:34:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 3094721 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 739FE9F2B8 for ; Fri, 25 Oct 2013 09:34:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 40569204D2 for ; Fri, 25 Oct 2013 09:34:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2817F2025A for ; Fri, 25 Oct 2013 09:34:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752595Ab3JYJeF (ORCPT ); Fri, 25 Oct 2013 05:34:05 -0400 Received: from mail-ee0-f42.google.com ([74.125.83.42]:35617 "EHLO mail-ee0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752573Ab3JYJeE (ORCPT ); Fri, 25 Oct 2013 05:34:04 -0400 Received: by mail-ee0-f42.google.com with SMTP id b45so2308142eek.1 for ; Fri, 25 Oct 2013 02:34:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=/ZQO0ncfv8hJrEPmpTgR3HJSw7BciD98mssvCoUUiDM=; b=JCp3ywVKTx1Aav0+au5Uxr6+KFAVWm7poBxnsxfxpa/nUqs/lEZh/PVo3PJW3lEKC+ dXVLD7b9tUpm+YgEMqhnU30hppPfFSuhatBGqsIM4mT5+PPUVZtqZ6MmUD5eJ2ndCJdO AXqQGi2DojqQ5vgtss+7tgGPmBa7+PA+tHMikWIhBV4w7pZEPJTBiHr9ej37mpIU8aS8 VvQp97KwSNppZQZu4E3oWr9396N3c3N9K5RXmkyv6dIWUrjn6qp6j0hKojWVggF8DRv+ +crOfGe6LBybPG0xU5z2Y4/i1pqfS1pQjYq+XKYjAdHutP/owPzPi2Rh9SaTONmQATk4 utMw== MIME-Version: 1.0 X-Received: by 10.205.3.7 with SMTP id nw7mr3227717bkb.26.1382693643501; Fri, 25 Oct 2013 02:34:03 -0700 (PDT) Received: by 10.205.19.10 with HTTP; Fri, 25 Oct 2013 02:34:03 -0700 (PDT) Date: Fri, 25 Oct 2013 17:34:03 +0800 Message-ID: Subject: [PATCH] [media] saa7164: fix return value check in saa7164_initdev() From: Wei Yongjun To: m.chehab@samsung.com, hans.verkuil@cisco.com, gregkh@linuxfoundation.org, jkosina@suse.cz, rdunlap@infradead.org Cc: yongjun_wei@trendmicro.com.cn, linux-media@vger.kernel.org Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.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 --- drivers/media/pci/saa7164/saa7164-core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-media" 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/media/pci/saa7164/saa7164-core.c b/drivers/media/pci/saa7164/saa7164-core.c index d37ee37..896bd8b 100644 --- a/drivers/media/pci/saa7164/saa7164-core.c +++ b/drivers/media/pci/saa7164/saa7164-core.c @@ -1354,9 +1354,11 @@ static int saa7164_initdev(struct pci_dev *pci_dev, if (fw_debug) { dev->kthread = kthread_run(saa7164_thread_function, dev, "saa7164 debug"); - if (!dev->kthread) + if (IS_ERR(dev->kthread)) { + dev->kthread = NULL; printk(KERN_ERR "%s() Failed to create " "debug kernel thread\n", __func__); + } } } /* != BOARD_UNKNOWN */