From patchwork Thu Sep 17 08:19:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 7203261 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 55B269F40A for ; Thu, 17 Sep 2015 08:20:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 88662207DA for ; Thu, 17 Sep 2015 08:20:11 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 80FA5207D7 for ; Thu, 17 Sep 2015 08:20:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D0E0B6E0E6; Thu, 17 Sep 2015 01:20:05 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) by gabe.freedesktop.org (Postfix) with ESMTPS id D15546E0E6 for ; Thu, 17 Sep 2015 01:20:04 -0700 (PDT) Received: by pacex6 with SMTP id ex6so14279503pac.0 for ; Thu, 17 Sep 2015 01:20:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=LeX5WvVuLVA+CnRV0oDmUzfKkWRBMbZ4J5XyM0k9kZU=; b=FHFXHICvB4xJ3jARHHxhXmcExpPJRinpAmQhadOUIFEc0C4rCdRINLDsixaRZjE6HO EgEuTVSEkpDsIy0vsn2BAwGvAzFVui1/j+xn4I5d74TB6/hkrrGxzoHCbmke7bzBUNLX goZ4wQjTHQAuRstPzcRIXjoSScX/sw5/LMiwHmJ0frNq1BfntlB/iPcjAhE8lcaxPTin lqZWfn6iT8N60KzkhiFmnhrJR1aJHy3YhJ+1vdWiSU9uCfgbhX1Gb/rhueZqY5EZHiGn ItVqNrwcCa4DDnmGvpTRW7KsuI2nyp5lJTN1C23/G2kbZ7EHFAh7l7fY8aQ2E4g6hkTf ATHQ== X-Received: by 10.68.68.143 with SMTP id w15mr70446713pbt.56.1442478004402; Thu, 17 Sep 2015 01:20:04 -0700 (PDT) Received: from localhost.localdomain ([49.206.249.64]) by smtp.gmail.com with ESMTPSA id zc4sm1612539pbb.24.2015.09.17.01.20.01 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 17 Sep 2015 01:20:03 -0700 (PDT) From: Sudip Mukherjee To: David Airlie , Daniel Vetter Subject: [PATCH] drm/vmwgfx: fix return of garbage Date: Thu, 17 Sep 2015 13:49:53 +0530 Message-Id: <1442477993-16652-1-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.9.1 Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Sudip Mukherjee X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Incase of error we printed the error message and returned ret. But ret was never initialized and so we have been returning garbage value on error. Signed-off-by: Sudip Mukherjee --- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c index 61fb7f3..43ed33f1 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c @@ -1685,7 +1685,6 @@ int vmw_kms_helper_dirty(struct vmw_private *dev_priv, struct drm_crtc *crtc; u32 num_units = 0; u32 i, k; - int ret; dirty->dev_priv = dev_priv; @@ -1711,7 +1710,7 @@ int vmw_kms_helper_dirty(struct vmw_private *dev_priv, if (!dirty->cmd) { DRM_ERROR("Couldn't reserve fifo space " "for dirty blits.\n"); - return ret; + return -EIO; } memset(dirty->cmd, 0, dirty->fifo_reserve_size); }