From patchwork Tue Jun 23 19:55:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 191594 Delivered-To: patch@linaro.org Received: by 2002:a54:3249:0:0:0:0:0 with SMTP id g9csp1363770ecs; Tue, 23 Jun 2020 14:18:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzv8zFQxJaDCBInwaroYSUGAfr2dHyyjNNGNc1Alykhzu4pqzXoocb5lBq0JRcSbZs7gZwg X-Received: by 2002:aa7:c496:: with SMTP id m22mr24353369edq.187.1592947116629; Tue, 23 Jun 2020 14:18:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592947116; cv=none; d=google.com; s=arc-20160816; b=tH4QXXHxA0VaH7e3Pph5cdUaHRah+iIGzupzZfb1h/ZPndYov/hUHZjvIC24dSXU4g c142EbCOrauXzqHBhdEh00DziwjZsQrMq+hjjZCr41e6bQWcPa7vpyPb1O/ZKgKveJg4 fYjiG1E99X2TdjOQ/T7/yQWf6oH8SBH76oozlZzFUnW2YflamAD8qqny1kkPuzEURSOj +/2xLZoDIZ4ajglfchNweq0L6ozTHCP9gnOUAhtmcsCPOgvTcfI1ZPRQmSdV9NyUzDnQ 0G3c3s4gCso60aBQD7igZQWgZdztcvf92di1+r3wKFuTXrT736H7N57HkKSto1Ir3XjT 48Vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=HLIX0YrW7hZ4bXEtpG3gJlf/2hza8dxla2NAoQafABE=; b=vIGX7RmlcVbj8zrD6fAx8bXY2PcG+PpeJSTi3HI+ow6J81ImkcujMkGmEavT4+HgrI JQ31VWqUb0njf0bNwAeoeB9ayLS80T4QwjZUAxCxiyFXHogy9CnXbonefW+R0+34AaKI rBwOvbgaGHVQPYwYeEJVgVyFoy640hL+YETV2ZctphVzBm1BBSKIcqFKPb5A8Np8Ir/G adrCh75uPuNebiVpu0nwmrv6dr0SFoGxWrb0cYpMEeg2uBsiHTpElD729vlFzVi+4/lB HKI1Ir8iFXM+6aHOsMb8AXD2lLFHXb4W33C3up2UwRQqUV3v4Yl4wA/L2yZvH2WsJajZ n3qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TXdQuyuD; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a24si1478615ejk.208.2020.06.23.14.18.36; Tue, 23 Jun 2020 14:18:36 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TXdQuyuD; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390580AbgFWUZq (ORCPT + 15 others); Tue, 23 Jun 2020 16:25:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:44784 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390329AbgFWUZp (ORCPT ); Tue, 23 Jun 2020 16:25:45 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 CFC8F206EB; Tue, 23 Jun 2020 20:25:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592943945; bh=9IyFQ1LxdVrwBZSwUEShij5X2ILrV9XEJsqS8gNrNjQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TXdQuyuDe1SFgvItjpqkDdvWM3fVkNSD/eR6PFyXsntrX7BO0OCX534kvTAfWXsLi OLgykoAPB+FLFnz+1JF8686YTJvJZReqaWZPpzMjywZpFj9kkPJJLv6obPhGWSNB5n ZcRDWxrby0c7/yk2rADB1dTGISufLl7EEbJ6jNyo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Srinivas Pandruvada , Jiri Kosina , Sasha Levin Subject: [PATCH 5.4 113/314] HID: intel-ish-hid: avoid bogus uninitialized-variable warning Date: Tue, 23 Jun 2020 21:55:08 +0200 Message-Id: <20200623195344.257639843@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200623195338.770401005@linuxfoundation.org> References: <20200623195338.770401005@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann [ Upstream commit 0b66fb3e6b7a53688f8e20945ac78cd3d832c65f ] Older compilers like gcc-4.8 don't see that the variable is initialized when it is used: In file included from include/linux/compiler_types.h:68:0, from :0: drivers/hid/intel-ish-hid/ishtp-fw-loader.c: In function 'load_fw_from_host': include/linux/compiler-gcc.h:75:45: warning: 'fw_info.ldr_capability.max_dma_buf_size' may be used uninitialized in this function [-Wmaybe-uninitialized] #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) ^ drivers/hid/intel-ish-hid/ishtp-fw-loader.c:770:22: note: 'fw_info.ldr_capability.max_dma_buf_size' was declared here struct shim_fw_info fw_info; ^ Make sure to initialize it before returning an error from ish_query_loader_prop(). Fixes: 91b228107da3 ("HID: intel-ish-hid: ISH firmware loader client driver") Signed-off-by: Arnd Bergmann Acked-by: Srinivas Pandruvada Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin --- drivers/hid/intel-ish-hid/ishtp-fw-loader.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.25.1 diff --git a/drivers/hid/intel-ish-hid/ishtp-fw-loader.c b/drivers/hid/intel-ish-hid/ishtp-fw-loader.c index aa2dbed30fc36..6cf59fd26ad78 100644 --- a/drivers/hid/intel-ish-hid/ishtp-fw-loader.c +++ b/drivers/hid/intel-ish-hid/ishtp-fw-loader.c @@ -480,6 +480,7 @@ static int ish_query_loader_prop(struct ishtp_cl_data *client_data, sizeof(ldr_xfer_query_resp)); if (rv < 0) { client_data->flag_retry = true; + *fw_info = (struct shim_fw_info){}; return rv; } @@ -489,6 +490,7 @@ static int ish_query_loader_prop(struct ishtp_cl_data *client_data, "data size %d is not equal to size of loader_xfer_query_response %zu\n", rv, sizeof(struct loader_xfer_query_response)); client_data->flag_retry = true; + *fw_info = (struct shim_fw_info){}; return -EMSGSIZE; }