From patchwork Tue Jun 15 17:26:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yizhuo Zhai X-Patchwork-Id: 12322535 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=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 43F72C48BE8 for ; Tue, 15 Jun 2021 17:34:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 240A0613E4 for ; Tue, 15 Jun 2021 17:34:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231882AbhFORgJ (ORCPT ); Tue, 15 Jun 2021 13:36:09 -0400 Received: from mx5.ucr.edu ([138.23.62.67]:2383 "EHLO mx5.ucr.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231657AbhFORfb (ORCPT ); Tue, 15 Jun 2021 13:35:31 -0400 X-Greylist: delayed 424 seconds by postgrey-1.27 at vger.kernel.org; Tue, 15 Jun 2021 13:35:31 EDT DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ucr.edu; i=@ucr.edu; q=dns/txt; s=selector3; t=1623778407; x=1655314407; h=mime-version:from:date:message-id:subject:to; bh=W/Agxa+mpwusp9Cgi9SCSo4oM2dq2tyEp2RYhM5gf80=; b=NlOHpCj1hVUSYNnXoOMUJFVeePxLGjOoqnMMhMbyD2gKIK6moWxPRM/Q uFLF9SS1uVwLQE9sm2Gd3z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dr: A9a23:vOetM61zZusZL+4uWWLuHgqjBLskLtp133Aq2lEZdPU1SL3+qy nApoV56faZslYssRIb+OxoWpPwI080nKQdieIs1NyZLWzbUQWTXeVfBEjZrgEI2ReVygeQ78 hdmmFFZLPNMWQ= X-IronPort-Anti-Spam-Filtered: true X-IronPort-AV: E=Sophos;i="5.83,275,1616482800"; d="scan'208";a="220159647" Received: from mail-pf1-f197.google.com ([209.85.210.197]) by smtpmx5.ucr.edu with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 15 Jun 2021 10:26:20 -0700 Received: by mail-pf1-f197.google.com with SMTP id s5-20020aa78d450000b02902ace63a7e93so10704238pfe.8 for ; Tue, 15 Jun 2021 10:26:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=OYK6lzODuclGPxJjXdB4mgKjdrNpwT3xXkrS1G/arSg=; b=azrC/EufM5BarFCpD14t8ZNUWL7RAElcW8A8UinvBxnTiBUKas5bSMjwJTERafV2YX vvWDAUIjU9AJIAvxJvli6qXlbFyMvwEPT1K6fu867mzOBcv2HjYAdl5s7//DrM9dXuPk JvXBsHLjhKMGj7gkcgbDVZJs806yx1tMOe29nYFe9nHVhgM53n9kgokt07EL3BCwEv0j R0SMMpN37ebzW9aqnyiesme4JlP5WdrCqwJa3Ky86W6/Z4jfwpe4/u1uShcdzqifP10M 1lGUFef1mar4M16LqgKHEJ67ZpPUQ3a5+/xLl0WK8ZD3wdLcRo4c/Dh8+tg4y76n2YfI 4OGQ== X-Gm-Message-State: AOAM5300kvogr1Q1fiQJDFbMK1SLmChM+d7+LCyuLUw0ShAfqch41LEC 9/wVZ634uUHKqBPk0Pnvk2YZofhlo7okHkbh+Pi+MK2CWLkFi6aPFxzOyEuRNAnbfjgZJNyKR9G +8I5N6rdt+FcVch2IBkRbHvPWRImy9eqRKXX4H9Md X-Received: by 2002:a63:805:: with SMTP id 5mr543992pgi.353.1623777980105; Tue, 15 Jun 2021 10:26:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCZQDekeP9cckWRs4Qg7Emd8mJjO8LA9Ll72Yzdgd0bVHJTbot+A9NY9vUzYbgiuUR37w81ZzzBWssd47GWmI= X-Received: by 2002:a63:805:: with SMTP id 5mr543973pgi.353.1623777979808; Tue, 15 Jun 2021 10:26:19 -0700 (PDT) MIME-Version: 1.0 From: Yizhuo Zhai Date: Tue, 15 Jun 2021 10:26:09 -0700 Message-ID: Subject: [PATCH] Input: hideep - fix the uninitialized use in hideep_nvm_unlock() To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Inside function hideep_nvm_unlock(), variable "unmask_code" could be uninitialized if hideep_pgm_r_reg() returns error, however, it is used in the later if statement after an "and" operation, which is potentially unsafe. Signed-off-by: Yizhuo --- drivers/input/touchscreen/hideep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/hideep.c b/drivers/input/touchscreen/hideep.c index ddad4a82a5e5..49b713ad4384 100644 --- a/drivers/input/touchscreen/hideep.c +++ b/drivers/input/touchscreen/hideep.c @@ -363,7 +363,7 @@ static int hideep_enter_pgm(struct hideep_ts *ts) static void hideep_nvm_unlock(struct hideep_ts *ts) { - u32 unmask_code; + u32 unmask_code = 0; hideep_pgm_w_reg(ts, HIDEEP_FLASH_CFG, HIDEEP_NVM_SFR_RPAGE); hideep_pgm_r_reg(ts, 0x0000000C, &unmask_code);