From patchwork Fri Aug 14 11:52:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 7014391 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 0D1679F344 for ; Fri, 14 Aug 2015 11:53:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4A6E020788 for ; Fri, 14 Aug 2015 11:53:32 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 278A7205E3 for ; Fri, 14 Aug 2015 11:53:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A00876E764; Fri, 14 Aug 2015 04:53:28 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pd0-f182.google.com (mail-pd0-f182.google.com [209.85.192.182]) by gabe.freedesktop.org (Postfix) with ESMTPS id AC1BD6E764 for ; Fri, 14 Aug 2015 04:53:27 -0700 (PDT) Received: by pdco4 with SMTP id o4so30913526pdc.3 for ; Fri, 14 Aug 2015 04:53:27 -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=tgm8n8G+ILLBQg8AXoT51jZn0zU6cM4wSgjk74wuaPA=; b=K3kI2KnziG1IOQy3jKM1r0+lY7PydhMbg2/geOQHumfaSDkqyT6Qb2bT3JdMiMwGP+ 6U00Uv1UXkZ2c+6uj727FPEWkfGqA1wuNAhcgBMH+GTBwKk4bCK8n/A7XfsqK1XpzcUC EuX+D5dKFzdcdNzaAbSgSeEObQHLio9audFOOkx93aOGXQDFS9fps4KWpJ2v995pJD7F XW3GggoOJxfl+Du7H6Augmp/pIuQ6iEeb9/8b1cZZjP0u6JE1a6+WVoD3UgdY9V+Ofph 5eaT5YQrfiStCzgI7fH8OAhtHp23eRhm18Fyh3iKmI2yDPd+t0snnCSuVb3G5m9AOE/O NjBQ== X-Received: by 10.70.98.163 with SMTP id ej3mr79977573pdb.61.1439553207264; Fri, 14 Aug 2015 04:53:27 -0700 (PDT) Received: from localhost (port-20419.pppoe.wtnet.de. [46.59.141.105]) by smtp.gmail.com with ESMTPSA id os7sm5818430pbb.23.2015.08.14.04.53.26 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Aug 2015 04:53:26 -0700 (PDT) From: Thierry Reding To: =?UTF-8?q?Christian=20K=C3=B6nig?= , Alex Deucher Subject: [PATCH] drm/amdgpu: Avoid possibly uninitialized variable Date: Fri, 14 Aug 2015 13:52:28 +0200 Message-Id: <1439553148-2690-1-git-send-email-thierry.reding@gmail.com> X-Mailer: git-send-email 2.4.5 Cc: Boyuan Zhang , dri-devel@lists.freedesktop.org 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=-5.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 From: Thierry Reding The min_ctx_size is only initialized for H265, so garbage will end up in buf_sizes[4] for all other stream types. Better initialize the value to 0 to avoid unpleasant surprises. Signed-off-by: Thierry Reding Reviewed-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c index f5c22556ec2c..91e79c3f2403 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c @@ -374,7 +374,7 @@ static int amdgpu_uvd_cs_msg_decode(uint32_t *msg, unsigned buf_sizes[]) unsigned height_in_mb = ALIGN(height / 16, 2); unsigned fs_in_mb = width_in_mb * height_in_mb; - unsigned image_size, tmp, min_dpb_size, num_dpb_buffer, min_ctx_size; + unsigned image_size, tmp, min_dpb_size, num_dpb_buffer, min_ctx_size = 0; image_size = width * height; image_size += image_size / 2;