From patchwork Thu Oct 10 04:38:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yizhuo Zhai X-Patchwork-Id: 11182593 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 45C69912 for ; Thu, 10 Oct 2019 04:44:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 15641206B6 for ; Thu, 10 Oct 2019 04:44:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ucr.edu header.i=@ucr.edu header.b="GnllRdci" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726304AbfJJEob (ORCPT ); Thu, 10 Oct 2019 00:44:31 -0400 Received: from mx2.ucr.edu ([138.23.62.3]:4675 "EHLO mx2.ucr.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726201AbfJJEob (ORCPT ); Thu, 10 Oct 2019 00:44:31 -0400 X-Greylist: delayed 425 seconds by postgrey-1.27 at vger.kernel.org; Thu, 10 Oct 2019 00:44:30 EDT DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ucr.edu; i=@ucr.edu; q=dns/txt; s=selector3; t=1570682670; x=1602218670; h=from:to:cc:subject:date:message-id; bh=Qglj1z/rVFrSvjj0s8+qncgzWBHeOEvd87vRgzQFxfQ=; b=GnllRdci589bKzJkps8n19oX4WWaxeEPKZMAh8uufzGt0kiMEkKXDeSf Gnqa/ac1bfNiD3m9Pp+fnsygVTQnKuZCFlv6iw++VsD2ipK8+LuCwMtNq NFdYEGnGDWxmrTwykZ34ungcCtkDEHGHe2h8r1DSn0nIUBmyfJ7GV6Z6K wodcV4bFQnbwEF+PIefAU9fp8NSSwva5j9tOtjQMueRiZwfXfKfAqy8np 5dvIox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4Q8iT+LRAGnYwIKBwYPI4FFgXxNJYFsCoFEUBAUgVsOCY5DITOBCI0/glQB X-IronPort-AV: E=Sophos;i="5.67,278,1566889200"; d="scan'208";a="14124587" Received: from mail-pf1-f199.google.com ([209.85.210.199]) by smtp2.ucr.edu with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 09 Oct 2019 21:37:24 -0700 Received: by mail-pf1-f199.google.com with SMTP id s139so3747330pfc.21 for ; Wed, 09 Oct 2019 21:37:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Z2jlPo7cNUsYiJLA96HLY+XLNur36/5ee7Rqvg0uC5E=; b=JHX4v9cyaf2KdstLqvZ+1vcpji2cPdlsGQ4zsGyUYZ+YakY8O9aVp5Fwup/eolCu2d f/X3gKPe5UOXJiKhQHs3gN6GMb2+3AF4FeI3Supb2ffhhJZ3yP3YMCZqW4zdshID0UB7 8a19LudJUCV7bxLUvVv/d9GWzsB5aKq27GMAJkg0vfkWUG7KAO279wl0o2FMi3fTQJUU WeV8LY9tzecl6ru/GUAZ4ISWAeFJkQtAuKwm/1A7qs2kJRJk13yEZOPfvf36Ina5HmHS 35l5y9Fb733KtV6VNkGj3RPERWc2EDwgbqU0SZYLGtPXG+aZgsC3kqLsq2I0AECXkIQQ ppwg== X-Gm-Message-State: APjAAAUp0uMugyvLgDpC7jzum7Yh6KwhWgbfYfRCmNkeaMYr+sbO0mU2 xr3iYhQQ6KLTcLYSPdeJ6eF//Aq9yezYgAKQ1h0QUQxPcfQNCjOVtfIEzhO/0CT4gB0cQr5ldvx 8y05QRqiiQ6kQklEAJPoGx50q X-Received: by 2002:a63:f908:: with SMTP id h8mr8409109pgi.244.1570682243560; Wed, 09 Oct 2019 21:37:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqzHyOtObFJngENmZ9WtxzkJ1f8WRSs7XqzpzG4G5O/ox5y97nK3RVIhkAPkPbp3dMBqdu0v/w== X-Received: by 2002:a63:f908:: with SMTP id h8mr8409069pgi.244.1570682243138; Wed, 09 Oct 2019 21:37:23 -0700 (PDT) Received: from Yizhuo.cs.ucr.edu (yizhuo.cs.ucr.edu. [169.235.26.74]) by smtp.googlemail.com with ESMTPSA id g12sm6544968pfb.97.2019.10.09.21.37.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2019 21:37:22 -0700 (PDT) From: Yizhuo Cc: Yizhuo , Sudip Mukherjee , Teddy Wang , Greg Kroah-Hartman , linux-fbdev@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH] staging: sm750fb: Potential uninitialized field in "pll" Date: Wed, 9 Oct 2019 21:38:08 -0700 Message-Id: <20191010043809.27594-1-yzhai003@ucr.edu> X-Mailer: git-send-email 2.17.1 To: unlisted-recipients:; (no To-header on input) Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org Inside function set_chip_clock(), struct pll is supposed to be initialized in sm750_calc_pll_value(), if condition "diff < mini_diff" in sm750_calc_pll_value() cannot be fulfilled, then some field of pll will not be initialized but used in function sm750_format_pll_reg(), which is potentially unsafe. Signed-off-by: Yizhuo --- drivers/staging/sm750fb/ddk750_chip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c index 5a317cc98a4b..31b3cf9c2d8b 100644 --- a/drivers/staging/sm750fb/ddk750_chip.c +++ b/drivers/staging/sm750fb/ddk750_chip.c @@ -55,7 +55,7 @@ static unsigned int get_mxclk_freq(void) */ static void set_chip_clock(unsigned int frequency) { - struct pll_value pll; + struct pll_value pll = {}; unsigned int actual_mx_clk; /* Cheok_0509: For SM750LE, the chip clock is fixed. Nothing to set. */