Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1525292yba; Sun, 5 May 2019 08:11:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqxOqFw02p7v38/aAGWQ6mSwMOAvzoOkvWuTTVRGTYaUS/5ebVPC6ZWe25ZBCje8sFiuGSxy X-Received: by 2002:a17:902:43a4:: with SMTP id j33mr25938544pld.307.1557069106277; Sun, 05 May 2019 08:11:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557069106; cv=none; d=google.com; s=arc-20160816; b=B5Jyp5NxXzTjuPXCGyxteXVBzBmb5PX/8ZIhxlg3NWgbXQHi/I3yc7dzerzrf84xPl bx4BGrRm9eEmjVXJErvwhGufwKb0zp4oiVU39gI27qwSmVQHZjROEjJmW3ItXyvCmJ6M 5rw+C2bIYelUI7R7z1xNH9GE6P+uRhzArrp4TuUcTeuEqK7OJs+uRqxDCPLezhkaxyvx fv4nISHyRV23sEO0jFpFpcE/JVqYwPn/HVGsEj3tYaBlSbnynsogKdwhHR2ias9JKNTi CHSkvPgTcuUx3hCaLXgNoogKZccroi4LSkngHJ6JgkIXwPzFpnJRwqGk+77Ehg5HmEL9 e0bA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date:from :references:cc:to:subject; bh=vErAgYaU+p6pEnlSKdytsHwYr7PH7TP66BnD+M0Ka8c=; b=qNk6RYYE4YabYwy4v8cUXqQxBu97U36BRRrLVBSBzeTtMrlcLi5UKQ2VhspOf0nfFz damu7HAdidwaTPCAGAXzs1hw8JUiUkLhhj9YmjbPZ60UxifkCsc27Pci+NK0S12Oe5iB Yo2UMCjwPQMSDlYNrU3HJkXzJUtXCW08iSv+fB/zjRS6XRSr71JZo9J4u9jNdZ1Pgc6d O92/SZY4pRCsKHrI+Al69PQN9QXApFj7wWF6Q0gThQB+rfmlWf0MoflX0KMNhgfmZ2RX MqeMxfwuMlhi0bt8XzeUIZ0ZdjIWNhhuMgedETnyAmOWVJ8sa97G9EhOKvU6i8GQgBrF G9Vw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g129si10155515pfb.181.2019.05.05.08.11.29; Sun, 05 May 2019 08:11:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727911AbfEEOW5 (ORCPT + 99 others); Sun, 5 May 2019 10:22:57 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:57494 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726397AbfEEOW5 (ORCPT ); Sun, 5 May 2019 10:22:57 -0400 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x45EMGCO000937 for ; Sun, 5 May 2019 10:22:56 -0400 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0a-001b2d01.pphosted.com with ESMTP id 2s9pe3jukv-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 05 May 2019 10:22:55 -0400 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 5 May 2019 15:22:53 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp05.uk.ibm.com (192.168.101.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Sun, 5 May 2019 15:22:50 +0100 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x45EMneM60883160 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 5 May 2019 14:22:49 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6EC684C044; Sun, 5 May 2019 14:22:49 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1FF8E4C040; Sun, 5 May 2019 14:22:49 +0000 (GMT) Received: from ozlabs.au.ibm.com (unknown [9.192.253.14]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Sun, 5 May 2019 14:22:49 +0000 (GMT) Received: from [9.81.221.79] (unknown [9.81.221.79]) (using TLSv1.2 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id 156AAA01AE; Mon, 6 May 2019 00:22:47 +1000 (AEST) Subject: Re: [PATCH -next] ocxl: Fix return value check in afu_ioctl() To: Wei Yongjun , Frederic Barrat , Arnd Bergmann , Greg Kroah-Hartman , "Alastair D'Silva" Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org References: <20190504070430.57008-1-weiyongjun1@huawei.com> From: Andrew Donnellan Date: Mon, 6 May 2019 00:22:46 +1000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190504070430.57008-1-weiyongjun1@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-AU Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 19050514-0020-0000-0000-0000033984A3 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19050514-0021-0000-0000-0000218C15DE Message-Id: <13d3bd90-1541-e484-ecc9-42b755be80c8@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-05-05_12:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905050128 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/5/19 5:04 pm, Wei Yongjun wrote: > In case of error, the function eventfd_ctx_fdget() returns ERR_PTR() and > never returns NULL. The NULL test in the return value check should be > replaced with IS_ERR(). > > This issue was detected by using the Coccinelle software. > > Fixes: 060146614643 ("ocxl: move event_fd handling to frontend") > Signed-off-by: Wei Yongjun Acked-by: Andrew Donnellan > --- > drivers/misc/ocxl/file.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/misc/ocxl/file.c b/drivers/misc/ocxl/file.c > index 8aa22893ed76..2870c25da166 100644 > --- a/drivers/misc/ocxl/file.c > +++ b/drivers/misc/ocxl/file.c > @@ -257,8 +257,8 @@ static long afu_ioctl(struct file *file, unsigned int cmd, > return -EINVAL; > irq_id = ocxl_irq_offset_to_id(ctx, irq_fd.irq_offset); > ev_ctx = eventfd_ctx_fdget(irq_fd.eventfd); > - if (!ev_ctx) > - return -EFAULT; > + if (IS_ERR(ev_ctx)) > + return PTR_ERR(ev_ctx); > rc = ocxl_irq_set_handler(ctx, irq_id, irq_handler, irq_free, ev_ctx); > break; > > > -- Andrew Donnellan OzLabs, ADL Canberra ajd@linux.ibm.com IBM Australia Limited