Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3641989pxb; Mon, 24 Jan 2022 14:13:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJyqch9hAmc7W75BPOf00j2OPInGUXOKqASDEwsM6ghCgyWTq7nPFow/+RdJFp58P/WYS4ob X-Received: by 2002:a17:903:1c5:b0:14b:f87:bf3b with SMTP id e5-20020a17090301c500b0014b0f87bf3bmr16067944plh.130.1643062381600; Mon, 24 Jan 2022 14:13:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643062381; cv=none; d=google.com; s=arc-20160816; b=uOKP9OFpxe9g/31m/qv7GHh1L5v3GkL6SSah8rLxwx+MoQRjxa+lwX46tJqYhRRB4U NX8Kgx0un/ES49+hsqwMV+/BkhajPneqHKz3KX2nI9lJ5zynEsanEKZkvD6GTqBelbw0 bQuZZS66LHE5hQwDQVfr949oFqFNWzZ2ZvXmFYmiMucF+vvWXkIcHzIvPmSiNVZZQano sl/XwDZDbgfcQaaV5XRilG+TzE29ihn4r5TZztLN5oBPmnfKfMWpcGnB2OeTL0tacJm9 0zI0pt2ICGLnU5LK7HN6PsWUn0GqoNPgYyjWoky0+WkiNDWNMVcIwfjZNW05yaETw8Oy P1kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vYgaky5yUPHPucReCOoDex4Ek+xVWwjrvKTOS5Sx6t4=; b=yJJUi0758SLMCxlsdMHs8QN9CpcVh7TYwnzo3ZnKXag/lc0bNhNHLE5wL1lkCoDWY1 itEbb4m4Zg2m9STXBesFfLg+zOocnmOp3YwFZtY9OjmM8VCczlSfj+AMCUEFyzWueRDM qazCr06vqTlqOfdhBBno1EihoQtle2LXLtNG/aRrSJgHiax98wVt52KyNM0LdyvTCAUl FyC5Vqy/3pFNfY4MMQVNePKQ099BtO2UgyriaEuiMwB6l51AIuX1Bc7YvKThKMquZ6k2 pz3FF1f834W++rNWbw1YwfFtcP2YOaP7KSVE2qkQM34i7dKe26SDq3ao5IVgyNp2cjs9 0dEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZSClZUqW; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nl10si580188pjb.62.2022.01.24.14.12.49; Mon, 24 Jan 2022 14:13:01 -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=pass header.i=@linuxfoundation.org header.s=korg header.b=ZSClZUqW; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1576734AbiAXV4L (ORCPT + 99 others); Mon, 24 Jan 2022 16:56:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1450888AbiAXVVn (ORCPT ); Mon, 24 Jan 2022 16:21:43 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92C9FC0604E3; Mon, 24 Jan 2022 12:16:27 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 30AF661480; Mon, 24 Jan 2022 20:16:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 00002C340E7; Mon, 24 Jan 2022 20:16:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643055386; bh=bTwDCjyp1FfNlpPdJ01CRAf9JzQtnnaDyzG6MorJD20=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZSClZUqWt9E7f8FSzceuWeLcdtj+yBgojGyXR7K/p5CvfPHlvknw1LXuyBEdvR+Rp 2QWWkZYq5z8Ntg1PpojVk9ahlP2VSitS0ksTo7FUu7LPnQkBxKhEwE96hHeC1s6GYg MpIUj/Y2497KHD4Ps7VQMmQztP8vhMaljZpKdSdU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Hans de Goede , Sasha Levin Subject: [PATCH 5.15 134/846] drm/vboxvideo: fix a NULL vs IS_ERR() check Date: Mon, 24 Jan 2022 19:34:11 +0100 Message-Id: <20220124184105.613729259@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter [ Upstream commit cebbb5c46d0cb0615fd0c62dea9b44273d0a9780 ] 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 Signed-off-by: Hans de Goede Link: https://patchwork.freedesktop.org/patch/msgid/20211118111233.GA1147@kili Signed-off-by: Sasha Levin --- 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 f28779715ccda..c9e8b3a63c621 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, -- 2.34.1