From patchwork Thu Nov 18 11:12:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 12626611 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DDE77C433F5 for ; Thu, 18 Nov 2021 11:12:53 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A9B746138B for ; Thu, 18 Nov 2021 11:12:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A9B746138B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 86BAC6EB7A; Thu, 18 Nov 2021 11:12:52 +0000 (UTC) Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by gabe.freedesktop.org (Postfix) with ESMTPS id C5BE66EB7A for ; Thu, 18 Nov 2021 11:12:50 +0000 (UTC) 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 1AIAfUV9020985; Thu, 18 Nov 2021 11:12:48 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-2021-07-09; bh=+Quo5GPsReZyPfYZf5cp0aHq4acoHysb69PVQ5efw50=; b=1Mj81hxmdCIkX8gllPtH8eN0P5p0NPeSqcj89ZDe1lsz7WToSi9ZoVbp0KUhpUZ8q7aG swK1P/8BYcVmeAzNVglzdpuIahw1uYniglpsKwoWZ2V5ZWUT/UrVEbrDbH4cZENkY71g O3MYSVvNIOIPnJ5sJMWdvTd1QIiFBbN4oviWbrg4vHcwyeMK35GdtKChzsI1V5w4zHLb 3Ud/xDrkbpEnuJFit0v8cV1j1AcJxBd6uGkpgq85kLav0H7xPmC3T7Z7xpQe7rfwOo0Y lD9hoHA56X0iPCmRXnBDoWtaFQwgAJbF0B6KXwG1iqQT1Q9hFz5M8oLgy4Leha937gLl Yw== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by mx0b-00069f02.pphosted.com with ESMTP id 3cd4qynhe7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 Nov 2021 11:12:48 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 1AIBAJOS053809; Thu, 18 Nov 2021 11:12:47 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2176.outbound.protection.outlook.com [104.47.58.176]) by userp3030.oracle.com with ESMTP id 3ca2g0b24r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 Nov 2021 11:12:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JJT5iGcKf5AR6mnCINJsxxx+lhjB4cEYmuWiw2b/ErvfzxPW87Tu1A4pvnpGbUsgnHYxPQrOIEF4DjU4UVa++KRj7u3ma3YmmcEk/DQ6SOc7i28Rp7dObeUUCirVYNUwCtNvWz8aaK9mDdGZsuT1l3tmrlgvdnTns+rr6oo1FC7TsH/yt4b+F03xQ0nxUKX7ZFX3cy+jUuUtUVmWJFl9RCTJm287VBvQV3HRfvtgSW0mMyCHTGgPGKBxvMSFKsGk6ay0+RYdaYFV5afDpWDvcx0UIcWbXdWuwwiIFTOWT/LuN9qZ0PnpPSHPRPQ90dAITxm+V5m0bZ4gw0lAupNzRA== 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=+Quo5GPsReZyPfYZf5cp0aHq4acoHysb69PVQ5efw50=; b=cjuWTLqYh3Yq4EC92HgPnGVTYB8Ju4WADaI7IfWYgo7uh0GEYjX07SXVa0aMASwv3V0joN1rdpjGvp9+K1FUpjXJxfAz4eu/1LImYAOPvnTrzLMaU+SUnB4DB/l4hYPMCKxgKe82UYo4+gvxUad95YabbK6yKyQjbhDZBzShX/B/TCeoKE1v5orA1SafQ6PJzybm/YC9gwwYN64EKDeL7XN+GLGQJmlnVY31jutWrNi2z7IBZpkfMxOjIkOgTLN5CyGjXn9M3D/8IaxC+Oa5NnpEgH59XQCa+nKRrZ8P/9ke8IPrMhrqtKS4ggywvXXHeZpj7FndN5nW9Izqjwxz2g== 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=+Quo5GPsReZyPfYZf5cp0aHq4acoHysb69PVQ5efw50=; b=qCSZK+vmjDF3dtQuLQLVidXzs9TRhQT+2m5nqaE4pEycS1YFs7JcCCpYFOoRZicPGk3F0hXcboCt54SmTslZjlh40firBSIv2FYMNCp5nlPNCzRr2Tj+zDRzFIHsHGnqIXKvBs7gGxO9rhkxKyrbIJn83yLIQmyV8CDpuev9mN0= Received: from MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) by MWHPR10MB1247.namprd10.prod.outlook.com (2603:10b6:301:7::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.27; Thu, 18 Nov 2021 11:12:44 +0000 Received: from MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::d409:11b5:5eb2:6be9]) by MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::d409:11b5:5eb2:6be9%5]) with mapi id 15.20.4690.016; Thu, 18 Nov 2021 11:12:44 +0000 Date: Thu, 18 Nov 2021 14:12:33 +0300 From: Dan Carpenter To: Hans de Goede , Daniel Vetter Subject: [PATCH] drm/vboxvideo: fix a NULL vs IS_ERR() check Message-ID: <20211118111233.GA1147@kili> Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: Mutt/1.10.1 (2018-07-13) X-ClientProxiedBy: AM6P193CA0102.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:88::43) To MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) MIME-Version: 1.0 Received: from kili (102.222.70.114) by AM6P193CA0102.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:88::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.19 via Frontend Transport; Thu, 18 Nov 2021 11:12:40 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 867e5978-6828-471f-2a10-08d9aa845828 X-MS-TrafficTypeDiagnostic: MWHPR10MB1247: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:208; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3BB53l+HGX26xaUpPqhxvfbQDbb5sYDfZ7gjl9vKw+SzJwjumTud/PT4KEoL6m6WEeVsxz9gvMQce2wuFCKQ8fte8lyMozFn6F/FDHseUJZNbcF2jnNgHuKEwaELraa9aI8aYjO/EEMZZZjmE0GP8G0Bt8Rd3BTzBkL2vtRhLEZNwwN3qdsuPk+zHSeZqdxgYcXboDeZw0wulcbSY8DIYNboyu4dg78vPdL9dxABjn9rNIvJDxXpF1hh1dowsgMSFXr++hLSsYQxsxALhhdaf5jFwUvJpQtAX0+YxSBqwMNSP4Nm5J3UNEfC4l38molwVYUqDmMGdTp4txfuMSy/7RnavXFeUZIhw8sxEUf7ZDqzpS9bqWenKEmaKGcB8yi5GpJdFpIguVHII9zbsyyzKcFELOjbsGxn9ZmbEZy8C63UK3BGVzdMGiuQ/WtBNTlM2h3LnRwD/5b/afqHSTSb7tToepZarEMhrFFXifTH0EhvqRe2oS/ej4NAMMQ9qF+J0ouPk5IK9lvUpvtwGMPYp+7Agr1Zp8fOYP3D7q8TnK+QrP9m6PNVNIWi4hmbwsTcla+aCTmotX26IMjeWzgbAe0XMvCOCaKhYzUiYSdJ7CJ9xYS/+703pnfff9QeHduSUHFIpvNcLf3H9s04hfN0tyz3uoG/1KnTZdJAx5+ZyuUH014aVIBO91p1ouq/sE+eLygTO66LbPXrNuyz8jrp3Q== 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:(366004)(38350700002)(186003)(956004)(38100700002)(33716001)(8936002)(508600001)(9576002)(110136005)(52116002)(55016002)(54906003)(4326008)(8676002)(2906002)(66946007)(66476007)(6496006)(33656002)(6666004)(316002)(44832011)(4744005)(9686003)(5660300002)(26005)(66556008)(86362001)(83380400001)(1076003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: nLMcNwgJtdRSvXcxoJ9Yk72ghBmTxvhr/IppMQISV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bFhDaTwIi6Z9+rfHkLSEly4kJHynb3nAGfb0ae05qAbQ7pzOTfxi1RFn4xK+QmsYc3yrEc0zMRVMfPsTXYsjsy9fPRDEKkijvLlri+U14KwfyUI3s2ndXzp464GZ+fiTqwYc02eSIEs700mVi7Li2yVdmATZYroRMskL8DhrVQr4zw/M74gbgclUD8sEovl+P80Ioo/WaemVXKQeiMbpCnrHYnvx6FhXB/LiXJvRMwijokoDg5OGDULsOL5/LlemhxVQWGg9bcD3d4lF8ywYYiNYu/ApQFd/XZd/n4G3Jg85kaoI1NFdfmateI2dRbE+bsj4/BAPAkF6aShYMpwZjbHzoB3GzWWoI3VuSU8FRl+CFOBy2sXKSVjh6B9PNmZ7gHkFoAHJlXMUREh5Ld2qSJjJvqfsD5N9qb/hftPIxAGP+QJXcAjmj1rRvh8Ik7ae/3awkIPNp6tsVozu/BkpbGGSKKamHzJA/Tui0+UEURdnD5VyIN+VudlhUDKjd8s9UbnbzleSXPAwJ7RqmwJeTQl0bRXyknm1a9ReMC3xTvMWtoGoGcFPJq5CoGbqX+Fd30fcvAI/RuT0+WZGnrwKZL+iAh6dY= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 867e5978-6828-471f-2a10-08d9aa845828 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2365.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Nov 2021 11:12:44.3886 (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: QRrB064P+mh5ySJ9WaejO5LPD5PpJcWd63OgvL4Q740WhbEVcxADGBf3LleUhN5uBiFByQEHPm7LCg3voAyQJixqwsiq6Hh8B4eeIiaxbwU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR10MB1247 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10171 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 bulkscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2111180066 X-Proofpoint-ORIG-GUID: FzIz5OLZIzK6Y0bjmJzXv5oyZCXLiaax X-Proofpoint-GUID: FzIz5OLZIzK6Y0bjmJzXv5oyZCXLiaax X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , kernel-janitors@vger.kernel.org, Sam Ravnborg , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The devm_gen_pool_create() function never returns NULL, it returns error pointers. Fixes: 4cc9b565454b ("drm/vboxvideo: Use devm_gen_pool_create") Signed-off-by: Dan Carpenter Reviewed-by: Hans de Goede --- drivers/gpu/drm/vboxvideo/vbox_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/vboxvideo/vbox_main.c b/drivers/gpu/drm/vboxvideo/vbox_main.c index f28779715ccd..c9e8b3a63c62 100644 --- a/drivers/gpu/drm/vboxvideo/vbox_main.c +++ b/drivers/gpu/drm/vboxvideo/vbox_main.c @@ -127,8 +127,8 @@ int vbox_hw_init(struct vbox_private *vbox) /* Create guest-heap mem-pool use 2^4 = 16 byte chunks */ vbox->guest_pool = devm_gen_pool_create(vbox->ddev.dev, 4, -1, "vboxvideo-accel"); - if (!vbox->guest_pool) - return -ENOMEM; + if (IS_ERR(vbox->guest_pool)) + return PTR_ERR(vbox->guest_pool); ret = gen_pool_add_virt(vbox->guest_pool, (unsigned long)vbox->guest_heap,