Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp8126576rwl; Tue, 10 Jan 2023 09:19:24 -0800 (PST) X-Google-Smtp-Source: AMrXdXsLPvg07KDxCtpZFcUOwlx0XBiUHwQ76ZId3998y+p1YzaXKJlR4FvisAzZecubvEeCw5gb X-Received: by 2002:a17:90b:2789:b0:226:b39f:e7ac with SMTP id pw9-20020a17090b278900b00226b39fe7acmr21765174pjb.0.1673371164522; Tue, 10 Jan 2023 09:19:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673371164; cv=none; d=google.com; s=arc-20160816; b=N8cjdIzddIiA5/8Pr6SCF10CipiOCBXgedf24xjv1wcFqWb3zSsmh1vvf6oBdleg7F R4AsCQHkynUWnkCfibfyDqhiw6s2cDipqNiOTcZ+oPu9s6mnrK5Wj0fKBTfDPhainnGI dXK6dpJQjM9AN2hlnEtmMgh9vHK1PZV3Dbq5J8fN6ESQ4i0JBcXmZ0mhMF1c0iTmrvtX kR3Ont2nKh+jB2QZ1y/0uHjMQ+yHWwwmrLm22qk+/StodAP8JocS6XpEkYZ65h08lU+d SccCb5/xThMojrNUBEg3uKfWBy2T+En76rvgJmUORhVspl02+v+ol7dYq2e4vO9K6fj9 K/jw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 1-20020a17090a194100b0022678c40343si11594565pjh.21.2023.01.10.09.19.17; Tue, 10 Jan 2023 09:19:24 -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 + 53 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 Content-Transfer-Encoding: 8bit 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 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; -- 2.38.1