Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2876141pxu; Sat, 19 Dec 2020 05:03:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJwly7R1tJHycTS6lBiaRwMVZ34ozafBOsTxpDfTNH419yW9HHnq0SEpG0pQFV5i9RkojHj+ X-Received: by 2002:a17:906:4443:: with SMTP id i3mr6734672ejp.133.1608383019073; Sat, 19 Dec 2020 05:03:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608383019; cv=none; d=google.com; s=arc-20160816; b=tbnJigW27Bx1KU/PxSOwNP7wpuB+bhiuOLQFcjrYHYlb+6Kwadv5K88wNoIJneOkXc YIKfSC1haBQi3WrEyBtpzwcmu77YLQjISe9TsE0JW9kNyFqiYXBmMUiNqX28CntzCFvz cd1hASCAKC4bSRFLrN5yUxLU7d3bF6+ir+QcyA9klCl2sPArGFhlSJcKEJyeUYx8n1FB JB782A07TknooIj8TGovrR8nMcSoyVl1s0aCteVFXDrZ4VhU45jWoBqmqllfMeEBSb1v xLCho+Ja1s8ZZDp0lden7WOkDr2Bak3O7dyVoJSRHzRORNmIgLGuJntmNab9l4KUorUR 9JYw== 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=RAkAKbKHACOpXPotIA3mzotKizz/YHqokfaZOMOqfog=; b=P+HRJcbgWRye4joZhy5L/9i4ArroN3vm71SKwR1eQp89GsKD/Dmpd0r7qOM1eV69T+ Zw3/jd6E41oJGqflXQ9LDYTU3AasSjwp7FyeHD4mp7yMdxjpiZImlcuragury69wTMAh 4IRf1E6kq0niDq8/Xs7Ro3dxnHKaS4UHEuJCnt9puN1a9X72+D27X6c32RBJY+hE2MXa eXMS0Nku47Cr/keIXq5DcJVfmjIqx+o5+N56gzKsOppEAxGPaGnOLvDtn5ail2o9m9r1 EHeOfGy/C0xqdtKXypE7jXAciifWtjB2H9f9ROjtqjMJMYj16bGQo695g5ucZw7Sg95e QKjQ== 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 f5si7920834eds.162.2020.12.19.05.03.16; Sat, 19 Dec 2020 05:03:39 -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 S1728047AbgLSM7P (ORCPT + 99 others); Sat, 19 Dec 2020 07:59:15 -0500 Received: from mail.kernel.org ([198.145.29.99]:45104 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727833AbgLSM6t (ORCPT ); Sat, 19 Dec 2020 07:58:49 -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.9 35/49] USB: dummy-hcd: Fix uninitialized array use in init() Date: Sat, 19 Dec 2020 13:58:39 +0100 Message-Id: <20201219125346.389456695@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201219125344.671832095@linuxfoundation.org> References: <20201219125344.671832095@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 @@ -2734,7 +2734,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;