From patchwork Wed Feb 28 08:50:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5YiY5rW36b6ZKExhb0xpdSk=?= X-Patchwork-Id: 13575044 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1149AC47DD9 for ; Wed, 28 Feb 2024 08:50:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9615E6B009C; Wed, 28 Feb 2024 03:50:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 911456B009D; Wed, 28 Feb 2024 03:50:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 78B326B009E; Wed, 28 Feb 2024 03:50:26 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 685A56B009C for ; Wed, 28 Feb 2024 03:50:26 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 14205A1523 for ; Wed, 28 Feb 2024 08:50:26 +0000 (UTC) X-FDA: 81840591252.27.ABE6D84 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2096.outbound.protection.outlook.com [40.107.255.96]) by imf01.hostedemail.com (Postfix) with ESMTP id CF5DB4001F for ; Wed, 28 Feb 2024 08:50:22 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=oppo.com header.s=selector1 header.b=dd1bLmPp; spf=pass (imf01.hostedemail.com: domain of liuhailong@oppo.com designates 40.107.255.96 as permitted sender) smtp.mailfrom=liuhailong@oppo.com; dmarc=pass (policy=quarantine) header.from=oppo.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1709110223; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=5N7FqwmmZvqN09JjQRn6vDNUpQVIPMwU9aMA0Nx77NI=; b=kNmW/9QoIoyW0Anh1x7eTz+FZANY/fgK19OapXaHvAFUlBRolC0DJG+ROJ2H+5k6G3mnVZ mSzWEneQkBLVXac4hXW8hRDJ2vcP3W620VRhFUrCc38vu/DnqhfLSPYw9C0+YwMhbm1rUk ot0f2BE4VW9IeJzkymDsyU5G0uQWo40= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1709110223; a=rsa-sha256; cv=pass; b=PdXx0eMOYrxHCZ0N6AYJrFrhMX2qcwB1CXlTYe2IUVqSQPZ0t8T+dRf/yry03QGE1snlR/ h3lcakacls4EoBooF2xs0dqr8+wnqglDRBV5nU3gXhZtdUdTOtEzHaEftLfeye/GN53zG7 6Bqhnk7vRznhrt5YGe6sjX20iB9NDOQ= ARC-Authentication-Results: i=2; imf01.hostedemail.com; dkim=pass header.d=oppo.com header.s=selector1 header.b=dd1bLmPp; spf=pass (imf01.hostedemail.com: domain of liuhailong@oppo.com designates 40.107.255.96 as permitted sender) smtp.mailfrom=liuhailong@oppo.com; dmarc=pass (policy=quarantine) header.from=oppo.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k8Qum3/p14PBnh5u4JO9Uv5f41Wz09I8I+57dmfuRg8+aQYcH2wxbPELGv+x4oUrEMsB1jdd1YuP2jfB3uuMituLmYWcVA2S8SsjWawscCNHceAqeLtXxeSTM1EiEvmUuNjSOHshXx+hoxXx3SvrVPyvvsSYXoTJSj7PKBl2QtNiIlBjhYAzXN/5G0L3Q4I6h2WmYAGn6Br+9dMae3bOm2lZEibK73rg9I2pWMAsTCy7dDgYYj1kLRTtxtTugAE+PBRNP9jArTl2medBCiNDy7hLcqLvEXG+Zk25lrjjJTv7g9TZkElvKisUUqMbtcHG94QVMVpIcJH6zrk3TdqFxA== 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=5N7FqwmmZvqN09JjQRn6vDNUpQVIPMwU9aMA0Nx77NI=; b=l8VuzxG4t49IePNw3TyZsV6PoPmTtr/LrDPhs8+kJJ7GfV1S1biUnLQwNe8/moiaxashjyLJdGY3Oir/Rz9oWVz6waGexJgb+G1/qJWfPIQTivesP0xM/FpsFipqLQIMlP/PBCDYYsAH6XaNyxdGk3bPfFifROneqhZ1ywrBh1jmTYpdgpcSpG12FH4uDAoSjweL/d7l0lqhSXQiddxTm4XaRKnHcxy8jCZ3wJLV4N/zOha6CfOREkb6tRM7+8S4XVuDYcDd4ZqTLAuVI0tPf9EuxoprYDVFLgfzWcAryXvBuFfzcmZIkvRoZ3S3vZyCsI+P6rNi7KNMux+d+TU4nA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oppo.com; dmarc=pass action=none header.from=oppo.com; dkim=pass header.d=oppo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oppo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5N7FqwmmZvqN09JjQRn6vDNUpQVIPMwU9aMA0Nx77NI=; b=dd1bLmPpIYvZ33DHrP2ECD9I8TFY58qkVhZ8xS1LMw+edJkEVXrh3qdSXSUNcmUVWe0EY4oRMQEXVcDE87jhHbRuSqFaFrRN+Y74KVvg1pQX030pQNL2IvEzaNgPw5iLSEWLJuPeOXMp1Qr2eN5bSu43+S4ZIZmLlLAR7TGafOk= Received: from SEZPR02MB7164.apcprd02.prod.outlook.com (2603:1096:101:194::8) by SEZPR02MB7073.apcprd02.prod.outlook.com (2603:1096:101:19e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.38; Wed, 28 Feb 2024 08:50:14 +0000 Received: from SEZPR02MB7164.apcprd02.prod.outlook.com ([fe80::c54f:7115:e36a:591d]) by SEZPR02MB7164.apcprd02.prod.outlook.com ([fe80::c54f:7115:e36a:591d%3]) with mapi id 15.20.7316.035; Wed, 28 Feb 2024 08:50:14 +0000 From: =?utf-8?b?5YiY5rW36b6ZKExhb0xpdSk=?= To: "akpm@linux-foundation.org" , "urezki@gmail.com" , "hch@infradead.org" , "lstoakes@gmail.com" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" Subject: [PATCH] mm/vmalloc: Fix return value check for vb_alloc Thread-Topic: [PATCH] mm/vmalloc: Fix return value check for vb_alloc Thread-Index: AQHaaiMl/BXt6+jxSE2MrtR/YdMwFg== Date: Wed, 28 Feb 2024 08:50:14 +0000 Message-ID: <84d7cd03-1cf8-401a-8edf-2524db0bd6d5@oppo.com> Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SEZPR02MB7164:EE_|SEZPR02MB7073:EE_ x-ms-office365-filtering-correlation-id: 11cdcb2c-3f9a-4b03-2476-08dc383a47c7 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: k2qcM6jbBYiAX8Zod+9UsL3BSA3sFqd69s3vk4inmpY69HPSzhCxj7DhmZIr6viTAQ3YyGLrRxujnY70dBDUqtKWkml4jmCRRp4vanzNDO+Mrlk1h1PhNXrloMZAoACrKtD1rc3GjxEiJeN1AMXTxB/dACZzjNyUlssJ4o20n89Wr5Rn0UqVT2lTr5JoyuGPPw8oHRUtp7EJG2z4kiKDGILQDeVp6X0kXpVsWf+YiPtlwEbPDbdxQn8U2ITMkmLIfT+oXdowtBF4acsv08/3nTP3prX0EZjRmzPFNBd4KblVyRKzU9xThzEwfChs5Dswway0e6BpIBaaFr7KYseDC/MhuGyix7G5n3RKHvLmP54CZEbd7XZhgD9WqJkiwFuwxmqRmzClODNLAgMoM9q97qiisMKxevWH4XlX/ExznDAKRz5Cpb6ibCa+i0FcxJFH94M/EC8Ww5mHDqZ+KR3ROZJV37/T5WyTwRl3m6+OvEUK0MJEBysfS0ncKUOOiV+Fd8RgqD1oS6sO75zJqNA8SzaKNS6FKISPot3pv97MIDkD/Uj4elzoH/mQ9duZo7pg4CvyQAo083B+TE6h/mn50IueWUICEDf1TTZhsy8YqSQHCWIhOXMDgVE6hrHZsHtcaidQ1U3/iYZUxzy+vDWoySRBVK2+mVVoRqjcVVa7K85N3h1nHbGHHs5kzSWcjW4KZGGFhGosy5opl8qekk6lUqLXy9r3cX/cDciLF82Ckk8= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR02MB7164.apcprd02.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(38070700009);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?3+GUdRumHGfuDkGVMuU3w4xZ/128?= =?utf-8?q?gb/t9XHgMbXXN39YX0NAnhv8UKUPOo1879HDKsMVUszyl92upCFsOShu/sYDYeehi?= =?utf-8?q?HJSynaBy3roPLvnZ8FgBydlpZYCsinoyN1EW1z5YQDBtCkoOzImqVXvE1v1ogD4HH?= =?utf-8?q?ID7mk/4MhKfvi34ryIUbIwJcBVQVCXnhbHCf0GJ0Kd1LX7sbCEG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?= =?utf-8?q?KIQyhkIvl18xIvQ11rHue0vX1Xl5K3hwwYz49UGGza4UyH72HwBvOyuqGHXujXiI3?= =?utf-8?q?B04Kx1MFtHxBJw7kyUnJKMzZVH8rGXgBJyib4nNHeSAfWNrocmdPCTFszNpsPznqy?= =?utf-8?q?tSMwVcHFVmyw03WPSsuTZ7PRgL+ABQCnscrAfxRez5x5KMOWHHCPMwFlI/68VBYQw?= =?utf-8?q?xwa7SucIcWLHAi8BPHakGarWZD3rZPT1HV3I93wHTFeFaC7N7N2UYsYdcTLbd0C24?= =?utf-8?q?UNDLH/FQKUHxhE78XIIppmxVJIKxUfGg8bCzYGTkWVPBfjia6Ua2o9RFcezU5U1OT?= =?utf-8?q?BeF7zoMJ+LbTc0sXZyywo5pttNC/87wdq8R+hT79MLLPEreFcR1KuYyQWTHtAMdvt?= =?utf-8?q?duUO0L72Ys7DH8+cXybzrWr/M8PTZbq/sm5Wz2X0N3DAuMy3trOFSFQVgM4CgTFiV?= =?utf-8?q?E/3/1274ZbP5?= Content-ID: MIME-Version: 1.0 X-OriginatorOrg: oppo.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SEZPR02MB7164.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 11cdcb2c-3f9a-4b03-2476-08dc383a47c7 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Feb 2024 08:50:14.3095 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f1905eb1-c353-41c5-9516-62b4a54b5ee6 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: TOJVvBilI0oBwEmmdSu/o68AvRPTQb23YBjAl9kqetDzkWoyPUrwipK7oGPPEH2oxpbor7/NksL1qFVfXRmBvw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR02MB7073 X-Rspamd-Queue-Id: CF5DB4001F X-Rspam-User: X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SjNO98 2wl9TQ7qFCr5FeWneKX1qzNwXDitU3bln4t2E4BGPTmSaNxt/vdOTJL44fPb5cTz4NZWPiY++WoBMEsvWNv2Lo5tTl30nsYaZwHf6T5PK2NBo5LwQBAUFldB/By0reRj8FIOq9RyhzgNocDkN8WHW0DcpfVCAO/7SZw4jB4/cj0gYUcjj/BLsfT/dww== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000002, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: If vm_map_ram(page, 0, 0) would cause panic by vmap_pages_range_noflush, so change IS_ERR to IS_ERR_OR_NULL to fix this. Signed-off-by: Hailong.Liu --- mm/vmalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) } else { -- 2.34.1 diff --git a/mm/vmalloc.c b/mm/vmalloc.c index d12a17fc0c17..109732006cf7 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -2387,7 +2387,7 @@ void *vm_map_ram(struct page **pages, unsigned int count, int node) if (likely(count <= VMAP_MAX_ALLOC)) { mem = vb_alloc(size, GFP_KERNEL); - if (IS_ERR(mem)) + if (IS_ERR_OR_NULL(mem)) return NULL; addr = (unsigned long)mem;