Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2879352pxu; Sat, 19 Dec 2020 05:08:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJzAfpcTtgsGEtHzSaN9HQRVazZLF/sDL6ci8Z+gT8sxNqvXfWgF4l8NvYDCIbUrDw2EyMh0 X-Received: by 2002:a17:906:4544:: with SMTP id s4mr8282026ejq.366.1608383282612; Sat, 19 Dec 2020 05:08:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608383282; cv=none; d=google.com; s=arc-20160816; b=RL6386S8jzaDgyg2WthNKvr6prlrd42pbeNiTSnYTc92kRMz1gP+sxMV62Qaay7h7i RaV/InC5BdE3r47CQtq7cLiPXOPL+DhIXYukdrbSMiTeeN2qshky69wWqcpheyQUU4qX du+UDVURvcpqn8WYQAam/xGJjdV4axUIdoAHqqY3CkYA5zH+4fNIdCbFJh4na60iNtU4 kVznpL8003vJhPkXr7GblLob17d5XRT2sUOHZ5i023U5zEE/3nrL2ssGmkEjTYg6Lzbm QqlzFtZHzh8tpFweNm7gN23SjC9hFWoSyRJmrqTIWqov467jW+sb9NkKnBe4nPx1rP+x F+FQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=unhpXi5kH2txoIeYb8hqp00F067b3tI5RKTN5Q1HllU=; b=kWflcOgWcLKrehBvo3gx0KFHIyvIiCXZZ9YoEsTHL34JlxCcLFA6CaMU2EqiIRQTOR dptfB6LuQWYI5FdoVAFd32bOeC0+S1ojw8O1uRKtWDbVJPzdj2UglkGkr9EH2Petq6bC hH7sfAE6KdwozFUoVVjdaFwrQDgwJHLlCB80g7GJRUUrhVAzcuL4TJDM1jnZNrXq+PE5 VvShxaRVrNTCvLiiyNKjAV0N8pWIYMZCzR590UrlWBIJNLmNxQtChLpxVDBSEd8MPtLc fwb9Bsl71aUK799L802nLP8seYFWvxOlehkCi2Zy4oc7klMJwZOB3rLts9jMqcpM9vCL o3oQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o22si6250335ejg.205.2020.12.19.05.07.40; Sat, 19 Dec 2020 05:08:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728338AbgLSNDw (ORCPT + 99 others); Sat, 19 Dec 2020 08:03:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:51364 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728018AbgLSNDq (ORCPT ); Sat, 19 Dec 2020 08:03:46 -0500 From: Greg Kroah-Hartman Authentication-Results: mail.kernel.org; dkim=permerror (bad message/signature format) To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alan Stern , Bui Quang Minh Subject: [PATCH 5.4 20/34] USB: dummy-hcd: Fix uninitialized array use in init() Date: Sat, 19 Dec 2020 14:03:17 +0100 Message-Id: <20201219125342.382872361@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201219125341.384025953@linuxfoundation.org> References: <20201219125341.384025953@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bui Quang Minh commit e90cfa813da7a527785033a0b247594c2de93dd8 upstream. This error path err_add_pdata: for (i = 0; i < mod_data.num; i++) kfree(dum[i]); can be triggered when not all dum's elements are initialized. Fix this by initializing all dum's elements to NULL. Acked-by: Alan Stern Cc: stable Signed-off-by: Bui Quang Minh Link: https://lore.kernel.org/r/1607063090-3426-1-git-send-email-minhquangbui99@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/udc/dummy_hcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/usb/gadget/udc/dummy_hcd.c +++ b/drivers/usb/gadget/udc/dummy_hcd.c @@ -2733,7 +2733,7 @@ static int __init init(void) { int retval = -ENOMEM; int i; - struct dummy *dum[MAX_NUM_UDC]; + struct dummy *dum[MAX_NUM_UDC] = {}; if (usb_disabled()) return -ENODEV;