Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1738578pxb; Sat, 15 Jan 2022 22:47:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJzEp/MEk298YbM0iYtVBpcQjr+6DH0XsKaPHF7Q3sjqbKbROID7v5BhZHfQTxRZcZ/zGrwA X-Received: by 2002:a17:906:4c1:: with SMTP id g1mr12261940eja.148.1642315678653; Sat, 15 Jan 2022 22:47:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642315678; cv=none; d=google.com; s=arc-20160816; b=mFR2l6ufyQCfvdknU6dxTkySvU6n0Z1uiHLdSFX/SPhjT01KQHUkHww7Nbhd5BbHyN sC5qxWY5uo0gaHiwIElAZDsyeH02Xt2M+o3jqJZVMDWOCwNyGLqWbADLah4MREIotmcd RI29Ij4um/Be5ozUS/u3KfKCMz7q92sRM6wm7N9Dfv99ULH8cU9HDgvH04LFwVFFagMB L95lGDbDAYuW43a3FuevEE9P0G9RcYS3fSanY/A0VX2yHkaHgAXM/v8TQc4vUi9EeKV+ RpALBUOEZdOtH7JA8DXvAn8C3oBu38acLJh6WadsuY7b1XZ4MW/51j7h8gL+uq7M8q3Q A0dw== 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=xFdErQzZhWw36cmChgQUJSnCaxzupFnzpJu6evk43mo=; b=pdpeIllPxlFHWjs47lX1Qk3O9vbh4FaEcogumWvPDCdjcBFSALQvehapo0qFMXMKtT /v6cpD0xYXcdjJUAeJP4Bs5egpp0W1dCPBPDpryFKQGqrqJsvpTXXJzwOMFjxvSNdgEa ZWY/YIupLdoLxqDEjNCb6pECnmW7m9bG7Yvn90kXe6OL2OgoKT2jy9Fo4qZ2wblLXYyl lYMNWIokKjnzGpvSq0cb7dpvUv0ZbLxLcs6UqMCpdEtOr8hZuBey0ywgUZaw/SSkr6xE rDE0ss2iE/PpyjPWLmf3yaMv9sZmvoF4Glj5f/KTXlQih7rXpEiJEGqxXXvYt+ZHXdvV ahzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@oracle.com header.s=corp-2021-07-09 header.b=0YN07xkK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z94si5292693ede.595.2022.01.15.22.47.34; Sat, 15 Jan 2022 22:47:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@oracle.com header.s=corp-2021-07-09 header.b=0YN07xkK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S233175AbiAOQqG (ORCPT + 99 others); Sat, 15 Jan 2022 11:46:06 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:65278 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229784AbiAOQqF (ORCPT ); Sat, 15 Jan 2022 11:46:05 -0500 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20FDxg1q018448; Sat, 15 Jan 2022 16:45:57 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-2021-07-09; bh=xFdErQzZhWw36cmChgQUJSnCaxzupFnzpJu6evk43mo=; b=0YN07xkKKmTo6HudaMgLxjh5ZkjoEvQXMgK8kCRH6oHE2JskoRCyHQqHg32sufyroNzr pFGE5RSYaEUG/231fDrs87NINPd3gP4juzgM30ajdbrQAGLhvJUfoleJHKDfusOcgGZm 7Hj7FHyJTHy9WErAmyuzVrxXCoO1cyzzqtPo88AXDUwBSdgj8JgjImuBo+IIPPEli5Bu 7OVPnKZI4e+Rn+s5NisPMQSV1wRXd8HZ/ZRW9LrGhoUq93kLSLTSIi3rV9O1yny1F24j j0bkINFliy36x5sWT78Mg7YG2MPSNetfDu2KkmAPEVsgsslNC3gFaAHgQeNdRIu2RyjF Rw== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3dkn22rrm6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 15 Jan 2022 16:45:57 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 20FGe8qh128341; Sat, 15 Jan 2022 16:45:56 GMT Received: from pps.reinject (localhost [127.0.0.1]) by userp3020.oracle.com with ESMTP id 3dkqqhh8rj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 15 Jan 2022 16:45:56 +0000 Received: from userp3020.oracle.com (userp3020.oracle.com [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 20FGjtqK136628; Sat, 15 Jan 2022 16:45:55 GMT Received: from ca-dev112.us.oracle.com (ca-dev112.us.oracle.com [10.147.25.63]) by userp3020.oracle.com with ESMTP id 3dkqqhh8rc-1; Sat, 15 Jan 2022 16:45:55 +0000 From: Harshit Mogalapalli Cc: harshit.m.mogalapalli@oracle.com, dan.carpenter@oracle.com, kernel-janitors@vger.kernel.org, Dave Airlie , Sean Paul , Thomas Zimmermann , David Airlie , Daniel Vetter , Jani Nikula , Robert Tarasov , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/udl: Return correct error code on kmalloc failure Date: Sat, 15 Jan 2022 08:45:25 -0800 Message-Id: <20220115164525.50258-1-harshit.m.mogalapalli@oracle.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-GUID: EMXgLv04YryngQF4cU4jLsac9EK5n8tg X-Proofpoint-ORIG-GUID: EMXgLv04YryngQF4cU4jLsac9EK5n8tg To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org -ENOMEM is correct error code to return on a memory allocation failure instead of -1. Smatch Warning: drivers/gpu/drm/udl/udl_connector.c:27 udl_get_edid_block() warn: returning -1 instead of -ENOMEM is sloppy Fixes: a51143001d9e ("drm/udl: Refactor edid retrieving in UDL driver (v2)") Signed-off-by: Harshit Mogalapalli --- drivers/gpu/drm/udl/udl_connector.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/udl/udl_connector.c b/drivers/gpu/drm/udl/udl_connector.c index 930574ad2bca..b7a9c6d103ba 100644 --- a/drivers/gpu/drm/udl/udl_connector.c +++ b/drivers/gpu/drm/udl/udl_connector.c @@ -24,7 +24,7 @@ static int udl_get_edid_block(void *data, u8 *buf, unsigned int block, read_buff = kmalloc(2, GFP_KERNEL); if (!read_buff) - return -1; + return -ENOMEM; for (i = 0; i < len; i++) { int bval = (i + block * EDID_LENGTH) << 8; -- 2.27.0