From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8912EC282C2 for ; Wed, 13 Feb 2019 18:41:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 53257222D5 for ; Wed, 13 Feb 2019 18:41:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550083275; bh=AE+U50kFIsr5NAK1ItneCccMh2HyNxH6yGwjHIQq+QY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ALaTv7ETU+HvgnZUpzVdnw6QU7Ho6lG7BMdgU4HJ5mlEA17liv7Xyr2+v7loCgSRt ZyCFt/uZw5bYQtAO5Qe96MgJnkmYPRNXU/nl/IfMQ5Tza+lyV0GqR3IA7tA4DLZZna DPLhxxPNPU8pdESDEGKRVhrCx45F33Nd0Trh5Y84= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393792AbfBMSlN (ORCPT ); Wed, 13 Feb 2019 13:41:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:39466 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405507AbfBMSlL (ORCPT ); Wed, 13 Feb 2019 13:41:11 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0B1FA222D5; Wed, 13 Feb 2019 18:41:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550083270; bh=AE+U50kFIsr5NAK1ItneCccMh2HyNxH6yGwjHIQq+QY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f1Mi6KrXTJoqaOj2uujaZwZ/6PcI92egLMnPAhgN4W4DZz+iHHULo1BzVArjxNaBE 4xvKrCIsM5qzoY1ydu7aaiJcK5OimfgM6ItPoagjmc9UXldRYcY0xsh/1mK5L3GVro Hb2K8aAhkWJ44a+IHMBZaCUuYvU35hN2j7jU44X8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Hellstrom , Deepak Rawat Subject: [PATCH 4.14 18/35] drm/vmwgfx: Return error code from vmw_execbuf_copy_fence_user Date: Wed, 13 Feb 2019 19:38:13 +0100 Message-Id: <20190213183706.987378563@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190213183706.176685027@linuxfoundation.org> References: <20190213183706.176685027@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Thomas Hellstrom commit 728354c005c36eaf44b6e5552372b67e60d17f56 upstream. The function was unconditionally returning 0, and a caller would have to rely on the returned fence pointer being NULL to detect errors. However, the function vmw_execbuf_copy_fence_user() would expect a non-zero error code in that case and would BUG otherwise. So make sure we return a proper non-zero error code if the fence pointer returned is NULL. Cc: Fixes: ae2a104058e2: ("vmwgfx: Implement fence objects") Signed-off-by: Thomas Hellstrom Reviewed-by: Deepak Rawat Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c @@ -3818,7 +3818,7 @@ int vmw_execbuf_fence_commands(struct dr *p_fence = NULL; } - return 0; + return ret; } /**