Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752204Ab3CKNph (ORCPT ); Mon, 11 Mar 2013 09:45:37 -0400 Received: from mail-bk0-f48.google.com ([209.85.214.48]:52231 "EHLO mail-bk0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751352Ab3CKNpg (ORCPT ); Mon, 11 Mar 2013 09:45:36 -0400 MIME-Version: 1.0 Date: Mon, 11 Mar 2013 21:45:34 +0800 Message-ID: Subject: [PATCH -next] staging: sync: fix return value check in sync_fence_alloc() From: Wei Yongjun To: gregkh@linuxfoundation.org, john.stultz@linaro.org, konkers@android.com Cc: yongjun_wei@trendmicro.com.cn, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1061 Lines: 30 From: Wei Yongjun In case of error, the function anon_inode_getfile() 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/staging/android/sync.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c index b9bb974..bf66c19 100644 --- a/drivers/staging/android/sync.c +++ b/drivers/staging/android/sync.c @@ -261,7 +261,7 @@ static struct sync_fence *sync_fence_alloc(const char *name) fence->file = anon_inode_getfile("sync_fence", &sync_fence_fops, fence, 0); - if (fence->file == NULL) + if (IS_ERR(fence->file)) goto err; kref_init(&fence->kref); -- 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/