Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3624407pxb; Mon, 24 Jan 2022 13:47:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJyCdyBKCbRuDpolZ3Hi73J05K9DK0dKPPRFM7bs6wgDm6CWrFpNs9fIVNKiB46vGJR6zM1A X-Received: by 2002:a62:798d:0:b0:4c7:3766:e938 with SMTP id u135-20020a62798d000000b004c73766e938mr15830564pfc.64.1643060844359; Mon, 24 Jan 2022 13:47:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643060844; cv=none; d=google.com; s=arc-20160816; b=l0Kk4HBQQk6iFIXnNrxc+Y0NLITOtWcV9yFauDOFyKaFUKqR+O+KgSIdVtrIgnZLK+ f370v2/IbV6Y+l/QmgsFg30N/ma/MYbVPPTx9yPjfR+CqNL9QZd6guARhkASuqt3KzXX 1rhP6KmB4mza8z9ty8Sw1xXyTsVlTEMPZvxWtqGxa5A3NArgY97/Qieldru4QKivhSrV dsnaAIFfpxmu4qsso8dU3L+CmHYqjCAxKFKjmBy7hasSbdyorzdn6h+JBu8O8T1a9bg8 xzrdPGgRjgLaT0/hpTRHB4rUwvkk0ZdyTbq47ZB8lzzQRIBttmmfV/fzefuYnomk0VZz th6Q== 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=WtIDyikroq49n3sFc/xJWj3sRVGPj0b9F7lYUXjgeUVvzh90iI94cIUCiB/yIFTwR7 0Oim7HymueDlqlzJq10BaPcci5cjdHYsIczOBsgq+CzE/cWwMzeL4Ve2rkDo3TrCkGgA rV1cJqGfbptxYC1M04NZvZmO/uryowqb8iOh88Hs9YvPE1D8Pcqa66qQzu8ZjLueEQaQ Ca3r9OO6igKGRFfHK4zamTAt1WR2tSP3qcV1NauliSYsdCbR6gk8U10zX+UPb+Agd5V6 bfKploij0WA9aH2baSsk9iNcA4vDqecZ8/pBkm6xauUWT5XVmx6CGdct5cBzzTNxF1Cm I2QQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XXQIHGeL; 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 i36si19250998pgb.658.2022.01.24.13.47.12; Mon, 24 Jan 2022 13:47:24 -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=XXQIHGeL; 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 S1452474AbiAXVZm (ORCPT + 99 others); Mon, 24 Jan 2022 16:25:42 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:50964 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1444177AbiAXVAM (ORCPT ); Mon, 24 Jan 2022 16:00:12 -0500 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 8690660916; Mon, 24 Jan 2022 21:00:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A4FBC340E5; Mon, 24 Jan 2022 21:00:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643058012; bh=bTwDCjyp1FfNlpPdJ01CRAf9JzQtnnaDyzG6MorJD20=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XXQIHGeLBZkm7hOdrbkTwjs0R/nYoBsOz1m65fFkyiELlgecuYFYjCmJy89nKcH2j ob7odbtOAdsK9i5FsgaIQ2u0l/tOAUXIMoNfxLhyYufvsPrNZgr6AjlYPgDgoy1M6p juLOGvfQq9H5fQGw2Mghi7QSNaPvI+TurUtRN/Jo= 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.16 0151/1039] drm/vboxvideo: fix a NULL vs IS_ERR() check Date: Mon, 24 Jan 2022 19:32:20 +0100 Message-Id: <20220124184130.236313729@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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