From patchwork Mon Jul 18 11:14:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 12921116 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 187B2C433EF for ; Mon, 18 Jul 2022 11:14:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234429AbiGRLO0 (ORCPT ); Mon, 18 Jul 2022 07:14:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234428AbiGRLOZ (ORCPT ); Mon, 18 Jul 2022 07:14:25 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E413F100F; Mon, 18 Jul 2022 04:14:24 -0700 (PDT) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 26IB4KK1018771; Mon, 18 Jul 2022 11:14:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : content-type : mime-version; s=corp-2022-7-12; bh=M7fAHJoROFocPGuf4DzIUHyj2Ge6OLDGBxCMt3dHYHc=; b=Nce90reZrOtHUTdS2w4mQWLTAtmnTkrBz+UqrrNMCaOURk1ogPsESHTn+LCXs9SQ3bdG aDwUDWpQQqv57l46+JZngigOa2SQbw/4f+bPLF8MH6ki7WEJ9fM+83Lf2xiVwdGO0Xsl tWqPdXdrx3hAFh/gF9hXdfioVIpm4BwupT2ZF3JZ487waZje0D9fBGP087vWsc8tuaQV xGeL5rYRiwclCha9DueGe2CmuyKhMvvzHS1z1sWhTHrWhbYDmzFzqD5mKs68h/ybHhgq IXg2Zr1ey1F8bB9BtE/myvC4RARd5M65602LZhoAeKkrqR00K1uONEudPsTRz2C74T34 Ig== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3hbn7a2x8n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 18 Jul 2022 11:14:21 +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 26I7pumG028008; Mon, 18 Jul 2022 11:14:20 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2168.outbound.protection.outlook.com [104.47.58.168]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3hc1ma5pqy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 18 Jul 2022 11:14:20 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NueZjKQFVJPKhp56bPuULj1pAnzyNTiRpf3/HEuxlPOAzIaEjNl9z4/D1/LyILe9X8lWF93rUVOfgtYpTlNEwp98jewLR9cV1MfHaNNnFY5iC5bldQzOauDRRxYhpuW6RG6YCmAROx1E72nxb+R7nfUW6XTr7u/KfoIfHS6YqPr9kS8eADO+mDLe3fAb4EFAifAwfFFJvccaciYuZ3Wz1M3HQ7mVJCXxR+1DJC3EldvLQLt+n9ThQH4+S5MFoy7vtqHX5qgIq4a15v+bS/mo1vnMM24KIkZajvPIlOsL7qJQg+xHSc5Jsni8IZw5rl+eEKPgTRkW1BJ/yjpO62LHcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=M7fAHJoROFocPGuf4DzIUHyj2Ge6OLDGBxCMt3dHYHc=; b=Yj5vZHq8vx1duhpUCZAfNUW19knj5RnAQodMXpRMYpD3n6E45bGS+6dDuSx5YMcnNsjEkXI+Mooue/CzHAsodaf8iY0Q3TCzknawd8HhcYOv96Ea6Bfzr3EHEa4a8SDcDHfspLBwOGSaMBbzlfcvrkSPB/vmeeTd29f/k6cs1YrqRLtlObXlf0kefXhYLPtUaxttuSxHWjkK8+YclndSwD90Kkbq3AfZ5uKSTKD878I6DVq2HVcBbpyj2ciZxnn8xLxW/ReS/XHk7eABIFnAoI2G2uMEZgRdGcKjOlZa+wd37jGIrZ1L2Cm242y3IWFohsRcBmtMVXytoUJiaCcKsw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=M7fAHJoROFocPGuf4DzIUHyj2Ge6OLDGBxCMt3dHYHc=; b=xwXnTfxmSwrhGTV2cFlNb08xEc2XJLkyt6wuppQ9TukApgUoaWENq0scqXiuUQUuKwsZlE6UaACLJWXMUnWhuvV3q0mnbWr3l6noO0LNYwW1g34PhfUwMlHRUm8uEt1aSdDlJ+6/ffqMUZdxOYgH9ZlbPtvpteyRRGYP3rMiVNI= Received: from MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) by PH0PR10MB4757.namprd10.prod.outlook.com (2603:10b6:510:3f::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.14; Mon, 18 Jul 2022 11:14:19 +0000 Received: from MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::5020:9b82:5917:40b]) by MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::5020:9b82:5917:40b%6]) with mapi id 15.20.5438.023; Mon, 18 Jul 2022 11:14:19 +0000 Date: Mon, 18 Jul 2022 14:14:09 +0300 From: Dan Carpenter To: Jens Axboe , Ming Lei Cc: linux-block@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH 1/3] ublk_drv: fix an IS_ERR() vs NULL check Message-ID: Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-ClientProxiedBy: ZR0P278CA0175.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:45::17) To MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ee45123f-f81a-46da-30e8-08da68aea884 X-MS-TrafficTypeDiagnostic: PH0PR10MB4757:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BdaHa3FisMneDYTF9k54gEcYNaRsKabrwKnoQhzOP0QzLfcWsHuulgFLslaYeY7AhjYWr/o3nMihckmo9SKBneReg3AoiW5s+zC7cPKD36ffyGB3bS1IaNoia+rXlG9q4ZUh0lBHukwOEkkODjtcrr5+o1jtEiLF6XEr5eX1U6VSQ3dP5xchM3pV3eto08Y/jvsMV0QOkyrAkhQmb3yAKN6hZbrwrDJYhZdrelPIH1Rhg3sdhAm+FKp8WwreU25Bmo5tiVY8roBZ1++bPJe+2tD14e72Kvbrjwpig+JM6JlYE/KrgpIkD8lcLYDCo4dR8gyQZIFoOX8mUAdt5nuXnWizeu3d2OE8r+Lx6iomDQaAQ9Ypwt0OEDo3my4COi7t2ijlFePcDm1uul+Yi/prkgo5VJ8xQZW/3qY7xXvAuQOQMLI1NNkUngd3dOa3FP4IhaWQ7Gu3UOsHwlzlef4anmqxmuS/EWxzrftox1hTKwKCmoU9omdqHDDlm2ykLNRNVngLvgYx4pw28G9VSyuwT6qSqIWP1wBt27nXL4Q4d2y6u85LZp6h/z/NAEOQmYKZ8tXQBHddWDlkCZSOVOtxLUrr+RQGhnwMFYL8qZLw/jSY9DZNvNC4zO912AtEbRV2wFY6t8hQf+Y9sFiLuLLykP6pHSf8Cm0tPBcwqBqUX30gS8DG+G8Dqv0dT4JjNfrs+YMVE0wXFfwDbKeio/G8xjGnvn8PDHi4v+vB7iaaQaR4Z6kR6nXOAlHXwrRbNXqin0i2AQiqx7tjyWDMv4PO6/4JaDtLJ+6XEIir95oQ8/Zzln7pWjOorsOmr9t5uS88 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1001MB2365.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(7916004)(366004)(136003)(39860400002)(376002)(396003)(346002)(186003)(6512007)(9686003)(33716001)(52116002)(41300700001)(26005)(83380400001)(38100700002)(6666004)(2906002)(6506007)(86362001)(110136005)(5660300002)(8936002)(478600001)(8676002)(38350700002)(66556008)(66946007)(66476007)(4744005)(4326008)(44832011)(316002)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: rvglOwljHia7m79v1h4O4GVnXjth6w8BJxh3l9dtWjL+jm1SCSZWYLuPtZe62OdbvzI7VkXqGNnVehySSeF5KV9WJB76toD9rZHCkNUSrx6joINHPu58zqs9Z4kMo56szLO2KEKYmJeHmV4tYby+mf0665c0cvLkFT/dZY0cK8LcQrgj2u5vsKi72LxKCySk8ZO8iXTr5C9GpE9LyXuTk0KbMLw9Mas497FDOfIqyFRCIL/GCZPGYI5ZT8bGOxwq6olR5lIx1DRB8XIPgu+HYlO4wTUn+bJhqAaH3TB67adXMAs6xrgZja/13d8sikfwdKBf4ZuTOva9N9rc/OshBo/q/sKRXHCgdXE8iIuShwkJtGw17hXaxgRWG43oJ12QvPz3G7rhp0Fiji9UrgGSpTTtwADVNYiaciOqqNxxzWjvC+uMwINPTDsp/N58DgcS4V+cdRPXh8+gZ6NQOt5Zrv0SLcYlNolXSJ5ivc1iHAY5ZqVTSd2C5ZI4y3YnRiDA+WCqK51EYOcqhS7U6Hfs5XO3LX0MJJnOi6ydXN3JC67U8gp6zMvtmQr/1nPjKhbE2aFCz5drTnE+LHow496Jx7Hs9msXG+1j58PRlSd2RMHsk0bRMSFQ1izjQJmieMmpbUffYjmLTOx/AmIsDzlgh0yumZ7QRsEz7V6uRy7sZZChbV+OBilbt4wQf3iGojOdVgHaMbuO9AasW7M+X+gxKAoV65/mcHgS1Ifs5KV0KQtX/gl40tA4zY3GtRSRxIsotXoZi2SQhWG+9bwbnXJn7DCdjt3JSmWcM/pUgaS2kYrx74UEu7buegjqdPZhaQjoDCziKV/bx9fDleBDXIRvY7IuoFiJubMQM9SYTXtZV8hdAOczVTU7IT1IsrY3eqJdFWNWJt8SLjaFt/XdWPXuzBdyU5TAcs0myrcwrYpz0cC+/AWqOv4WXLKHfXYEbx78x3O6gwcTj2A25aspAnf9ab/bGBxCk9hJnkWfeCIsJtyZ8H9k3k+LNprln2wINPpxhaOA55y2aww3qqYUuDsIWsdKe+mRmBttLFjGfsAXdR+9Li3XMoKz0UFlUjxnsY+07BZS7PVGmcZcD8TLZqOBAsV5fud1puy/xudX/Ok+ZoDL0/D8MiocNgsrqRS7M8N5f8DqY7JHFQ1Y7iJMhZ8abPfzCYHAi8T42BIpz9Kfcu7cwzDKmqB2kgvKRceFIFsitcrf16KWmkqv8lcFfc4pBk7xlGWvvgn328URWz853PD0VoPSyh8PHoA6MvOfj6Ef+eCf7wisv7fYpEQYZelaisaSM85DSi2dYgQqdY7Sux8cCyBhdXKD87yOPG7WkSMYoPlMg8/dg9To8ameuTb4e+853I7GY/NNUfkoTLaoI2E+522Ej/MmLyN8fAe3EyW/sK44So++pAHU07S7mxwFJA9HdrU5b/puNlip+FBv9rbu96XnL5wEM4KLEKz2cA/RgJXMb1amiHaPtwq6rx91LbMjZNphCQoVBD4X6s8Y80Ll0qCrcTj+jeceWvU/vQg3yq7N1JDpuBEqEyye4wuPHm+dMZMMnDdq9F08MUrBKh5naM+OnGZ+dHu48Pk8DJ3JKrvHFk9UB1stILrkPFkxVg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ee45123f-f81a-46da-30e8-08da68aea884 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2365.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2022 11:14:18.8898 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: IIm1WvIbV1CWQSW0RnkEy+KSGsiQPdl0yCj0woZDdUWd90N6NUeMuo/AFups9vhaSBM2ik2/I1xIXGaaGIw+iDi/uPg7EjlDyV1XtPDt6XM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4757 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-07-18_10,2022-07-18_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 adultscore=0 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2207180049 X-Proofpoint-ORIG-GUID: hO85E_zWRunB4AnCsvNn9pqndzCC6NVG X-Proofpoint-GUID: hO85E_zWRunB4AnCsvNn9pqndzCC6NVG Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org The blk_mq_alloc_disk_for_queue() doesn't return error pointers, it returns NULL on error. Fixes: cebbe577cb17 ("ublk_drv: fix request queue leak") Signed-off-by: Dan Carpenter Reviewed-by: Ming Lei --- drivers/block/ublk_drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c index 52fd0af8a4f2..97725d13e4bd 100644 --- a/drivers/block/ublk_drv.c +++ b/drivers/block/ublk_drv.c @@ -1175,8 +1175,8 @@ static int ublk_add_dev(struct ublk_device *ub) disk = ub->ub_disk = blk_mq_alloc_disk_for_queue(ub->ub_queue, &ublk_bio_compl_lkclass); - if (IS_ERR(disk)) { - err = PTR_ERR(disk); + if (!disk) { + err = -ENOMEM; goto out_free_request_queue; } From patchwork Mon Jul 18 11:14:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 12921117 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6BF6EC433EF for ; Mon, 18 Jul 2022 11:14:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234403AbiGRLOf (ORCPT ); Mon, 18 Jul 2022 07:14:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234171AbiGRLOe (ORCPT ); Mon, 18 Jul 2022 07:14:34 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFA0C100F; Mon, 18 Jul 2022 04:14:33 -0700 (PDT) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 26IB3wlF031661; Mon, 18 Jul 2022 11:14:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : content-type : mime-version; s=corp-2022-7-12; bh=JJd3ujgoVFu6+8fH9V41njZNVSc97wTTTX3RPZwvasI=; b=g1ckdfapZ5ALET8FztHPAbPuvpjbUazKqCmfo0gfszB1G35jBcTASLxGk0zXuQNXk1Xd vBaMJRixkkqEucr17/l5SnD1+Xbc7u5AVHEcPPOE2g0T3JIvMWk9sSDXOOJAqAQz0fhF jUR8PzIAqEJ+nUNR0g5sl0GkA0WKXVCVfaYLJl7vRfRp/++2HzfjyaluSgE188ZY+BA+ TJxResszI5KrMMzikBJ3dmfPFT4ROC53RVPKWYW8sk8BDVkKv2ETmKf0S6jBg3J7lSaY xgNvnBGoUQdiR6CLwBFYT36yVnOZtD0SghXFxOLwMhtciG67r2gDAC5kbAhoHpA3p05m fA== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3hbmxs2x28-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 18 Jul 2022 11:14:31 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 26I8HSTc007936; Mon, 18 Jul 2022 11:14:30 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2044.outbound.protection.outlook.com [104.47.66.44]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3hc1ekg4n4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 18 Jul 2022 11:14:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ELaQ0cPR+zg3MquLPqT87ElRPlOvn5Xj3z4sTNLRoxjEkKVIpBphA0chZXGq2lTtCjVZ9rBkM9QPX1wwPfOWpwNw1CB0Vqvg0O2Nlyga94VDQoiWMU0qJiyj+fXH4QIQ7X6+058uOly91WvDZjJdzRWT/Qm8MlBSv5Mg7rBcAjD8NyRnuLE36H64Y0BjEhjCJfiuCVHd8z/O5dwInl4uP36ZB7BVFAWPN0LmJ9zVNr9IX8F6z0rBatfGpcxa2TmsFc830D0KPa+P+ye73dLTzTxYfgALUpee2StLvhx5pC7H5dAqMd763+L4vWyNnAqT7k2IEijcPbBzAyqpPa92KA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JJd3ujgoVFu6+8fH9V41njZNVSc97wTTTX3RPZwvasI=; b=JbfXtt8jWk3fQMXviKMEY81KUQ+k8AWAaPhbvje9W4LUa4sbjzv0z80ugDrSgJmm8mZG1AfgrMkYkTW8s2JnVyhLOewWSH5zwHaP7Vbb5d8CZZoSF0wO7ExyUOugIkB5fHeOuzxEVqrhSu2mn+WelfrOocZY/doBbZbVPZJHSLwnSNHnDAMzuzixbggJQ3YUV1DBZoVQ3DJlksw0ToRRQLWraZX5oMTRWEP6JD4USDMb2SHd/zvfBM3DK+feVJWgMAWW2N+auVhp1jM/4veB+w238im1JgyVHQd9pdwcaAz0QWrhQC5dmpqKlv3Y/EZmtZruG8D7u3gXPmR2toROpw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JJd3ujgoVFu6+8fH9V41njZNVSc97wTTTX3RPZwvasI=; b=RZ4zVs5iw65mK/IFDJvjYLfORmPXHoySMyfWM1dQRiT6MVkran3R8FB6z5Ey6VPI8vGeddH/kP91hvhb8BIgtMTneW/LpMZYZ1bXlPM2/VY0DuqJSgBU74ZJxiSrnbBH4BtjnPxkPkeuhKR7O/MS7NYqgamSQJFSVbBhbZSTkKM= Received: from MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) by PH0PR10MB4757.namprd10.prod.outlook.com (2603:10b6:510:3f::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.14; Mon, 18 Jul 2022 11:14:28 +0000 Received: from MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::5020:9b82:5917:40b]) by MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::5020:9b82:5917:40b%6]) with mapi id 15.20.5438.023; Mon, 18 Jul 2022 11:14:28 +0000 Date: Mon, 18 Jul 2022 14:14:18 +0300 From: Dan Carpenter To: Jens Axboe , Ming Lei Cc: linux-block@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH 2/3] ublk_drv: uninitialized error code in ublk_ctrl_get_queue_affinity() Message-ID: Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-ClientProxiedBy: ZR0P278CA0101.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:23::16) To MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e82c36ec-b222-4c9a-e306-08da68aeae47 X-MS-TrafficTypeDiagnostic: PH0PR10MB4757:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hoAvg+w2iK9KCju2wcepZJtWmcc5Lhk03koCCUdPnTmP1TzojNqaF7SRvHDNjK7aGvHaBXTN1z1t+9SZSUIDFCRNWuKc4cSHijKxsIKH5EzOWPdDuIN8cDSdMFdCI4+9sKzexmRAzqFHKR/hJS+9xlCbGyajob6xh1Ca7qbZY2rN3sEUlowHOliHmCWjUUDpLW2B6Sh1mUIE0iAFezis44X5Jyho3zboVzvozF2qeZwDH5jM+fN9VNZk5rhNDPaf7KeAotcCurzE/tYiHbPE6L6DqyUeoG28x+6sm6+vGIGE94CfPu3NCXGxzIWm4rxQ1/DjulY2PGTlAKsnEPo4QZhQIphAx9xFjSZGjk15F88kApYV/CjTp29QhxnHQGLRmKfN41YmbJQribPGEMiKo6lM/MPGYrqr8udfO7VtEwUoLRNmE4sEXupckGy7Z/9qXenWxFjd+VHdsvSH3VPbYhDioa0D/llJ38sVUVqZmiT2PKtzCWtZzPqWio7LGU377khVvOx/1uXOZOVs8AR1cae//oivX9GYXCvKmDu71ux15VHujH7L6t94ojBBDmRYgUBcCqwdMwrV7loisv5zzCnuwzCJeuBNWKog/Izop8qaPlRxvsm14uOzmgaN7dKKBOfEKXm7Tz8/7kP/w5h0HF9tH5q5j4XwgzFi2sgg0SNAXmqfuVMmd1fjHVqLj8Bg6fyM6WBIVzKqI+l3QG7LBg2IL0NRqMColLtiTsoT0GaRa4GRMAaNMdz1oiSqpB4gQzcXa5fMciqD4wMiI4YiQj9uePPironqllqniHPJ7mZJO2xMa/GK7vs81CkBUbpM X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1001MB2365.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(7916004)(366004)(136003)(39860400002)(376002)(396003)(346002)(186003)(6512007)(9686003)(33716001)(52116002)(41300700001)(26005)(83380400001)(38100700002)(6666004)(2906002)(6506007)(86362001)(110136005)(5660300002)(8936002)(478600001)(8676002)(38350700002)(66556008)(66946007)(66476007)(4744005)(4326008)(44832011)(316002)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3Nf35VOHkkIcAJSIDe3v9054gJ/dWoH6BXATP3MOtH1PyD/ER7gqMaDWxJaTfjyf1KWxWGBpCqV2LjkWy+zCod2J26TpU/+2uiZNwi8f76CaFzo3wFk4IuYbX+xNbP3v2kieB29OIfeASLFHAzlZJZDlnytsQWW+XpFsuIzdvR3ljkzIxOBfSxnMLs0b5Bfvm/tGigKuONovS8cibZd64H+e13KM9ts8hl9/E34SiHSrDwWnzLtgxETr5N4EuD4z1RCX3KtgsNGiQiK7E1adhSLqJkpdvGX8s/8yCy8jxEAP5F5uQMOjQ70IdgzAL1EeNjjRVKXGJDySN4MONjqZxbdqpQvRuBXgsv6lTa7TgvvYEQcMtYXqCwLsPNbnCYP9Tq3wtknDKFgVg29cIk5sifc31+Xo9oAh9eJMMRQPCr4dme0iVzFqqSGvEz8IYLyPViQi3j41TTEJ6QupK7fqmdWLcALfCe7cUkNFMOAncMkmiURJqBj2CYhpqYDixqvSDhmBsS5I48crXX1T4T5YhpwAXuK3jJuZWehjoIu/p/xSAbEtme2lrb8ED2405tdK9eZ6bf5uvSionTjQZLl11h3PZhYVCyfBTXUHcT6BSHC5lLsN7tsNYErUtG15i5ET/PL/++BCRZwUSrNUHgPrebL4sGnvAgFBEKrU5lPV6gx7boW1Kx0X4wEsaSvyBYagekQFBuFTlyEvgnANVAI61QHkwKWx90ewC72/tala4WoNVGij/1msgraYFqAm/7/ChCD9lyKPS+3RvPRSy5oOmrEN04Z2FrJnvh9HV7Vx/z3S0TOQZuWFGmvhpEpKssxB8QUmzs1MOdIyVeBhSDz354pQf6SyHnFPYgDLquxMKIAwJzvr64DaSS8RpBsdpjjFwO990YglKh/5z9b5kHYzhPb2NJs1P6DfVL7dBx6UhE13IsVB4SkL/4zd0tzdcbd7x9lHIRV3sQ9/tyfJGuCU4DEM130AH12Ld6dR3uKZYFbnrPQqwxXqOrkkjQMm3L+4+VJoOjtfcASvwwLHTlJTmdpZTCMwISEDvdwTigcvaGL17jcmP+Ud8Toi4u3Bz13Z2yGR4+aAHbIBlzjy5kgKYbqS7Fvy7rdvWHyNcsoKeMfbdb9KEMO6HZQOMAW1Qum1Mmr7B9eEoxGcVYTr7ziO1M9EYTWeOb3jq+ZIxgMtoJCKeiZ76buGZoqqg6giYb3PkjakODf+3XHYO40BooIO2NUIDAVL+bxEk289Y2JzuhbUU2c+Haf5FmH4H2OXGbdiMnCnzZTeynTHGuWEL2I+Y4t+6iAJSilj4d670RLrdaxNHZwyzcGAJzW8jFyHiVpambtcNoWftmzRGr/Aogz3KM0jNYzvEwYEe9YraMyhiOIgFxI6PD+xZXnBxahM6KitLRtat/3hYgTisPMaa+9NYoDJfITWeEI+00NoZL83CZ8JQNgMBV9kINNPyvRg9z7fzR1ywlwqcTkPH3pq5LaZmwkTDM8YXyqCjIJcLH2Sn7Lz4AEjnAN8GYEBMHOfbBJzGXcI1r/O7JSoAajU0yB3jJ9+a5DJBcff5p7jbvdppQ9D8NYgO6w6865DFECLmIE0bgf1izqOID8H0RRr+NMKBA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e82c36ec-b222-4c9a-e306-08da68aeae47 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2365.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2022 11:14:28.5297 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: AmftyONeD4ECe8dncYNzv5/L5eC+LzFfVqD6yUAYAUUjvxiX8vHNwDwPttbXZtD/9KvWGS2R7vVQ8i1DJRkry5hWB5+xfPw29uAO7OF6NRU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4757 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-07-18_10,2022-07-18_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 mlxscore=0 mlxlogscore=999 suspectscore=0 phishscore=0 adultscore=0 spamscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2207180049 X-Proofpoint-GUID: prridjUFBPNvUohz62zb3cVvtXm3ITS1 X-Proofpoint-ORIG-GUID: prridjUFBPNvUohz62zb3cVvtXm3ITS1 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Initialize the "ret" variable so we don't return uninitialized data if ublk_get_device_from_id() fails. Fixes: 71f28f3136af ("ublk_drv: add io_uring based userspace block driver") Signed-off-by: Dan Carpenter --- drivers/block/ublk_drv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c index 97725d13e4bd..c0f9a5b4ed58 100644 --- a/drivers/block/ublk_drv.c +++ b/drivers/block/ublk_drv.c @@ -1298,13 +1298,12 @@ static int ublk_ctrl_get_queue_affinity(struct io_uring_cmd *cmd) struct ublk_device *ub; unsigned long queue; unsigned int retlen; - int ret; + int ret = -EINVAL; ub = ublk_get_device_from_id(header->dev_id); if (!ub) goto out; - ret = -EINVAL; queue = header->data[0]; if (queue >= ub->dev_info.nr_hw_queues) goto out; From patchwork Mon Jul 18 11:14:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 12921118 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22FE0C433EF for ; Mon, 18 Jul 2022 11:14:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234249AbiGRLOq (ORCPT ); Mon, 18 Jul 2022 07:14:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234171AbiGRLOp (ORCPT ); Mon, 18 Jul 2022 07:14:45 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 988223896; Mon, 18 Jul 2022 04:14:44 -0700 (PDT) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 26IB4X4H029439; Mon, 18 Jul 2022 11:14:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : content-type : mime-version; s=corp-2022-7-12; bh=Q8PvU6X6YA6TpvEazIojhDdlNr5ecrtoSNymode+Cik=; b=QIsHl/eWvY0+bewVilwt6NYuTHG8SoLBwgxcvj4mZ2hA5VTrXE7P+kiRm6GW1hFFwl5x LFYbYyf0HPhVuc48RdqMErVMG0M7NnWnScduChUNv9ODejfxgD9bJ7aOIbB1JFUMiIL6 d2DamZ+8laORYZebnKNi3Mysf+Ba5fBGeB1oF8XlATtYhp517j+YrkLcg+I5UPhpsr5R Sy/Oekg6I/BPTO/sQj6HQ4PCkCsi3EXorH88YumLZHOQyFLN+OhbAZs+HeSFkjnDZkrN bY4ovT3UX482lfRti3PyTz5llZQ80qQMhJQ34KNyQi9Y4vB8gIQDiWbjAnWlIYwQq7Ho jw== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3hbkx0u106-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 18 Jul 2022 11:14:40 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 26I845XL002077; Mon, 18 Jul 2022 11:14:39 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2048.outbound.protection.outlook.com [104.47.66.48]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3hc1hqwev4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 18 Jul 2022 11:14:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jiboUjqHniBwjhTcvaWRn0BS8hGd1w55YjJC+2n2ifn+IFhW/LTd345ubOJ+uWWyseSXODuZPkbpTRhKgUxvxV1IO/IT/joRJXa47oa1EKv6YUIOSls66Qh2EmFyz4sgdfu2tgTFSuRWraNYa0YE8AMm4PY6D5VQ0vdmlkMqfd7QNn9S+zjepLNtBQDWq537fKwsSAmAQqto1lWsc3sOyOG5Q6KD5gmfIoPv65Jstof9B9KgUVaoL5A7hjGKsWqCiymL8Zqegftfywuow3rQbXkeiiVZ8/QDu/lJkGaVLKd691s4sVmi6eYVcd/xDkSe8D+EFVsqA1ddLX/lHKCk8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Q8PvU6X6YA6TpvEazIojhDdlNr5ecrtoSNymode+Cik=; b=OTsrQEzn8JubscMofw0mAnCj6M0/0W0ZjNxU2mmIw7FfLFgYjUv9DfG477vyPTHnxltv/AXjUIj1eExF+5kvdMxImzIQbnmxEoPEumf7im+ynck3ppXaRkuA9LFRwuHho71BW/mLlF/YEeJZm0IMEiVPa4i95MaJIjsK+kX8KJVR+WeZvJERHtdv2/wQxxiiK4ywUYM2hhOyYWSgWQWwtriRWRyoO2Qz5DFV2pJZKx/CT2ymKIlezuDzdlAKL+IeVe3peXPWRy5PA9+1BsPo9Ft+8NHcIndP+fVzO8h8CfuWuHq6NiPEA3x/FE4XYskg3D64Poa/oStHG5QD+k8Mdw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Q8PvU6X6YA6TpvEazIojhDdlNr5ecrtoSNymode+Cik=; b=V5y8Xk8t5mzcyGn84e9Y3pAh4FaoeitZvPeV/bNPMnkZyzZLJsM7dgSFf4gOumwM1T8Ccd2P/JMEkUkMByeAE2PQlErYvBIrehH3IqpQ1fFJ9pBd1hONVKFaSOlCjuK5U0QdfJfYiYcNePTRNarzgyjMpMXGV4HV3KAPceM2YTI= Received: from MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) by PH0PR10MB4757.namprd10.prod.outlook.com (2603:10b6:510:3f::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.14; Mon, 18 Jul 2022 11:14:37 +0000 Received: from MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::5020:9b82:5917:40b]) by MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::5020:9b82:5917:40b%6]) with mapi id 15.20.5438.023; Mon, 18 Jul 2022 11:14:37 +0000 Date: Mon, 18 Jul 2022 14:14:28 +0300 From: Dan Carpenter To: Jens Axboe , Ming Lei Cc: linux-block@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH 3/3] ublk_drv: missing error code in ublk_add_dev() Message-ID: Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-ClientProxiedBy: ZR0P278CA0031.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:1c::18) To MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fbe63659-fe26-4465-4f77-08da68aeb381 X-MS-TrafficTypeDiagnostic: PH0PR10MB4757:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FTxpmIOn9TFOy72mjFB+FTFhoXhyTCuQw25lg13BafJgRx0JDzPBgpmSxTUeS6TUMf9PFt0GW2mOGr1gLkbTRSpDeL+GgPHISeNr8ZxecWkq6Yydfd/JVIO332QB6L6BvRfWpzcH7ANSWq3Zio2XWbtDJIKrf+Jbmdm2SPMF+IwuI0ly8CftyN/ST2Tuv9zm8mwiZ/UAuSs+jwpvjgTLIAxpUs/R1K4j0vYQM13AtVpJ4D9m9cdWJ9bJN1OlUf43oJfYS0R1bN+zNoCPREOuEFv1yiHTVTMOvfGx50h0GvxqCann2ZCQ8fuB9IR56eUhQCZJjiIVA+AZq4SXhZGnBBu9AWTV8soQKOEgUkzJmHGqYUF4H8pAgpXoClKckamiGOhcihRt0rF9LIuW3Drq33n8XIRs/xIcUCMhQJn1Qrzl3lKJhLHGe7GiN7WHCDH+haBJ8C+TU03N2+T9plt5K0AwdEhYmbhRHrYlGnpEDTypIx9bG61nfI55pA2rnhNzuhhktBOcP1Qo82Bf0D22yelra437qgs1EAEd/vrxBZYCEj2hOyj150aLF0MyGG4ofoShlNXQgtfrQCZ1/+3CgKh8SIgXwFfV9oTLiiS2o0rb5Lg6ToV2jlkqijXIFEzlJ0cAhvRTZDBxBzclPzasd3SiwPd2vDJR67WD9FGOPvXgdsmMjxmrG4ShdYIcsJ5exIfOKi38TMm+CrvmaIEiN4n/TaNM7R2n+cTnYBxKNVjofwQm1eJRx7DJU7Ztr3WH/5fMQ6uOwQ7ute4yFuroa4dFzxyd/Yut1ZZ+wJWqaQmrcL2+L8t1XSmhAvsjvS76 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1001MB2365.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(7916004)(366004)(136003)(39860400002)(376002)(396003)(346002)(186003)(6512007)(9686003)(33716001)(52116002)(41300700001)(26005)(83380400001)(38100700002)(6666004)(2906002)(6506007)(86362001)(110136005)(5660300002)(8936002)(478600001)(8676002)(38350700002)(66556008)(66946007)(66476007)(4744005)(4326008)(44832011)(316002)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: kCaVkDBT/F/L7MCH+lC1FCqdxWqju/ToGcWjC0KT93faMndlMzrbLXgpuW26ZAKSvinlTxNEi719iaXzLdt7kJyx7yN1aUF4W1xpo5s0YiV1tHK7W8o8ID75PUwigb/lT5T7WVxRuPFf2Lhpgzq4ImkPCqMA5D+ZGQsRp6j0E8fEGrh0cpaInIIxyVetencBHmHGPFq2Pm8PFsegcNokpTBU1DqZG0Cl5bSXwCIpr6+DtrPVY//4A0UY0SLCWI2ZKlWPvfb53qIxUKpiMiur+D1r+z5Nn/yX9wNQUPqWWb5zHaaTr0Jt7/BtC39ugEsyzCYDJuVMAJVO6SLu6OUfNBLtZb6m2knwRKf/o0iFMcbneUVY9ahoNh4J2XARxyf8uVFFWRRUon7Yf7AzNLyF5OAiXQ/OpXIcfhztbh7Rb3bT7f7BQOqcVGjg6x8hX1ihxZxVpS3FbrAX4hhzX6+pQYkqGPtzQQJSUmQ3KlA7mNXlmkez/mzUuaCPQXbCmxAwp62WeSx4DJuDI4P2ok2ToXXpnrGuOQNIGmXylvn9v3ShgZ1ShJqinxjEqp077RyKq8q2Jo1D+dxMO+At1a/ExEB/ymcP7QW/+MGucnYLRsBucWH2W+B1CVDljRHGvZ/Vm2K04bGFNqwoKMjZiQb7XVLndZr9qddXHfkXyKkpV+eq68UY+2+HPjQF/9g+V61Bhwm0oonim//cQAjXQGTb8W5sEUqUGfq+O6W+R7GRIkjTCsCtjFl4uWSpZZ0Iq5HFfVeQfPiK/m/qrqFN7qShZE2+nOn1v2k+4tIGPxYyAtGGTvdaBE00rVSrRhoTGdS0S4AaRyM7I75pavLrkjTkNw0aZKnnaWqR08QVie8OMhKegFZkUlHaVagN9SUXz5ImQuiVdJMVIA48VfICn76TjSBSGHDyVKqnI6PoG5qdIEuyIOLGVmQt4TgUIjel13p/g+nd+rYgcLo1EL5wRvRgRlU1Yco3I3Jyt3pwHPcXch3nnxeUWf5LjD8Cm/Moz5e8lzCTs+rJsxUx8PbhI+ZQxBpTQkrw9/sqmll/jTCcyRZKw0oH6GaDfkgVQDEOTpDb/45hgUDS9JeLtjdh64VuWI7PQu36HEoZ7txnDfU9nUzHM2iRcUwuMj0hM1+pafLYg2dpLVwlD0emltCKxkzgYD4JX8wBNpP5lHJA97G9cIsxbEykVllRLoAOvdG+csZBInUqC3lcksoFM929tP1BC4DOd8hkNLuhS13nvrrW1a0fSJNrfNd+jG+f5NSpNyeGF9M4NlleiaAHhiS/OBZHJQVZDOp9KVUfsYQfVg+O1zm7oWTWFIlQcxtRvDQIfshy7EJnp/C0woc01tZkPAG+6Shh56RHQjz3D1BVEFFrh1ZDDGvFH+U358qF8bHbZw6vFmebkWDSzrw7vQIEQ6smTFgUZMTLbgxVbIXJ/fIDhyL3f573W921u7aLTkxJyYD2Bn/fWSn9WKhFecYfEBID7mdYe9JMA900F7m27tqz7vn5Z4MM/S7O+zdiuwX/v7Eq6NGKZHINdH4WfTPzRf64zhmR0I5+Xy0Dm8lTjg8BXwfTMFH1DdFyQLQYoWZox47+D858g1LLrFxPU1KpBwZYLQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: fbe63659-fe26-4465-4f77-08da68aeb381 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2365.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2022 11:14:37.3259 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: mo2eof9vvwjl881RjcyaQa1WeHyiTH/PXLuYyQPrib17fAQXR//RLZh1q2Zrd0VDMPSmdrCo87yZWPKeK5qmBsH19vL5craKWtu4Jwtupe8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4757 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-07-18_10,2022-07-18_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 bulkscore=0 malwarescore=0 mlxscore=0 phishscore=0 mlxlogscore=999 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2207180049 X-Proofpoint-GUID: OuWOVK_kNIydnnsoO4SXn_sMIKIRS5ic X-Proofpoint-ORIG-GUID: OuWOVK_kNIydnnsoO4SXn_sMIKIRS5ic Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org This error path accidentally returns success instead of a negative error code. Fixes: cebbe577cb17 ("ublk_drv: fix request queue leak") Signed-off-by: Dan Carpenter --- drivers/block/ublk_drv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c index c0f9a5b4ed58..332472901ff8 100644 --- a/drivers/block/ublk_drv.c +++ b/drivers/block/ublk_drv.c @@ -1169,8 +1169,10 @@ static int ublk_add_dev(struct ublk_device *ub) goto out_deinit_queues; ub->ub_queue = blk_mq_init_queue(&ub->tag_set); - if (IS_ERR(ub->ub_queue)) + if (IS_ERR(ub->ub_queue)) { + err = PTR_ERR(ub->ub_queue); goto out_cleanup_tags; + } ub->ub_queue->queuedata = ub; disk = ub->ub_disk = blk_mq_alloc_disk_for_queue(ub->ub_queue,