From patchwork Tue Jan 10 16:46:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harshit Mogalapalli X-Patchwork-Id: 41544 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp2856160wrt; Tue, 10 Jan 2023 08:52:20 -0800 (PST) X-Google-Smtp-Source: AMrXdXvR4qLMhnwgM9GRL4QrF/0P3DSdvK0URj+pYpajt2Iotj6pSmRwYfu8KsdhG9lGiBgp7RrG X-Received: by 2002:a17:907:d68b:b0:7c1:691a:6d2c with SMTP id wf11-20020a170907d68b00b007c1691a6d2cmr79810091ejc.7.1673369539993; Tue, 10 Jan 2023 08:52:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673369539; cv=none; d=google.com; s=arc-20160816; b=0ed1mC1nmwhSxCG5HG/LTS3PtKW+7GFyqiz8cLQBeU8UK80bq/McvjUgREo0GI+oxe /vha+QDkgxDB/n7f4X1Q3hio9fLBRAUAknrIvc4FrXVegWronm6XZ5uoCeAN1bHc1VM8 l8wzK4brZsIlIBPXpK/8BG2/jvtgMpArKtlVUwsqiI3sbdDaR8Fn4/+PJ7xi/uMKRiaR 9p0hOz4QPHpVbmPoaTAiYljfuBttd6l60S3VIL5LpyLCTQDczs+WTTo8SSAKBMancywf s2VMqowPQj0GomrkhGICa2g2AoPJR7NKiqE6Dr6Wd0JG0Zg5CShmekmvWfHpozjxAoCJ BOyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=QJUF0EYLzMOUTI62ymv5S3l0n9U5Ef29yIQZvUvPEj0=; b=Z6NeIVUfhplbOq9usQkuOpArqesBYh5D8Fp2novDJlW3pjq0PtEpuQu5OWKvzpn4DG Arle9jgPO1KqleZzKo1TMnPqAgTBAeXaoVF/5we2P1IKYRs6LvU+qsWMUzkFaoojhl/+ EXKFBRwhvDjWwDEDi8lWsq5Vk3RC2woVJ52DsNxDZZqsIvgxuBIgIxjpm4urbJNclwTs tOWzFRwoNV1lRdJWwwKzlLkoRzqHtpzS/e8AesWBNx+j8W/jZYyZKz8OXTOWxXIHKMLK LHoktC4NYJPtPvQ0Zzx6CHsD5DUr8xYHkrMgc3+HnSLun0Ml6rTats23YQJQC8Hpml+/ qRfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@oracle.com header.s=corp-2022-7-12 header.b=D7YzUyUo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q16-20020a056402519000b0048d06445a1asi14759410edd.286.2023.01.10.08.51.56; Tue, 10 Jan 2023 08:52:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@oracle.com header.s=corp-2022-7-12 header.b=D7YzUyUo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234682AbjAJQs4 (ORCPT + 99 others); Tue, 10 Jan 2023 11:48:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238958AbjAJQsE (ORCPT ); Tue, 10 Jan 2023 11:48:04 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85600307; Tue, 10 Jan 2023 08:46:55 -0800 (PST) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30AFd6fV016227; Tue, 10 Jan 2023 16:46:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=corp-2022-7-12; bh=QJUF0EYLzMOUTI62ymv5S3l0n9U5Ef29yIQZvUvPEj0=; b=D7YzUyUo77xU9B66U7UjywNhNOMJAuDpVVffvJ+emeZ0ndDCh6DXAzag2Ler6epuWQ9V m6fKIPOHh3dUN3rAMFAc8ni7dSLK5IXsDq3WB2z/d9oXvCsqp4XVjtRMtzlgRSjAISa+ KzXMzWZhm22nz873MacXa9n+q/TRxstKiVd+eBr8+oIrNoAtcP5XEXLQFfkYcxwdhi06 X4H1I6T/DmZWG1981eWMeCnuxIUatQI76DZ+hflYNvKojAltg9gpVGrKSzG1l2jZzkH9 ESs+PA98/X5hiJG6UYe2l8LBhcGGvyYopw5T+Q3km1CqB/ffMYuoARjTWxv9XYR3TIjS CQ== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3my0btnr7j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Jan 2023 16:46:54 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 30AFmr81004243; Tue, 10 Jan 2023 16:46:53 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3n1b07ud5a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Jan 2023 16:46:53 +0000 Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 30AGkqbe024140; Tue, 10 Jan 2023 16:46:52 GMT Received: from ca-dev112.us.oracle.com (ca-dev112.us.oracle.com [10.129.136.47]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3n1b07ud3y-1; Tue, 10 Jan 2023 16:46:52 +0000 From: Harshit Mogalapalli Cc: stable@vger.kernel.org, harshit.m.mogalapalli@oracle.com, error27@gmail.com, darren.kenny@oracle.com, Jens Axboe , Pavel Begunkov , Greg Kroah-Hartman , io-uring@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 5.15.y] io_uring: Fix unsigned 'res' comparison with zero in io_fixup_rw_res() Date: Tue, 10 Jan 2023 08:46:47 -0800 Message-Id: <20230110164647.755556-1-harshit.m.mogalapalli@oracle.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-10_06,2023-01-10_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 spamscore=0 mlxscore=0 mlxlogscore=999 suspectscore=0 bulkscore=0 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301100106 X-Proofpoint-GUID: qSilBPErbdW4hvZCtUcok_-SR5N9NO1l X-Proofpoint-ORIG-GUID: qSilBPErbdW4hvZCtUcok_-SR5N9NO1l X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754654731812434546?= X-GMAIL-MSGID: =?utf-8?q?1754655138837988572?= Smatch warning: io_fixup_rw_res() warn: unsigned 'res' is never less than zero. Change type of 'res' from unsigned to long. Fixes: d6b7efc722a2 ("io_uring/rw: fix error'ed retry return values") Signed-off-by: Harshit Mogalapalli --- io_uring/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index eebbe8a6da0c..fd30c99be07a 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -2701,7 +2701,7 @@ static bool __io_complete_rw_common(struct io_kiocb *req, long res) return false; } -static inline int io_fixup_rw_res(struct io_kiocb *req, unsigned res) +static inline int io_fixup_rw_res(struct io_kiocb *req, long res) { struct io_async_rw *io = req->async_data;