Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9041552pxu; Mon, 28 Dec 2020 05:12:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJxWSEkyN6sEGVfTqF7GfFviGnqq2uN28QdncBOdPsElCstTIkOzn5ERmT8i3Wth5N1yMXyH X-Received: by 2002:aa7:d916:: with SMTP id a22mr41919550edr.122.1609161133471; Mon, 28 Dec 2020 05:12:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609161133; cv=none; d=google.com; s=arc-20160816; b=v3nO/Ax+9tGQryLWhOPSlmF2ZqmZQYybqeK2dTJit5qU5sxBD7gwhxRKXzyVR1ByfY ZPnKebLGhszMQeGcUNFS0E2exqBMgx6mzxQ+03nrsv3whXAOOElyiaq/aOCBv9+UePjy dT1eTxwjHUZAoM8EQ9iJqXB7NcjDnGiFw8bjlVuudetw5xlboHu0hLeU8o5Yft2jbT7X ITogf1gRoQCPF45mzr62te3a7FStr8N4OQP5iTYN4XWEO96Mmla/kRp9G8E0ISkqGak0 ziUkuHwzVZcGjJpKv8JA73hOtbdgdDyjC0pN62Zw7evU99TpFTJGDFuds/teHypGSNgY UFUg== 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:dkim-signature; bh=K8Kq6ykl8cfuu31mv7Qq4FI18zc+wu7WU0Tg5UOt6Z0=; b=dgmOvjSoY1SbfhCPiiNaKyfscMrRXHTFangdAb/mN71CXSnOI3KDbLjCqA00rTuGnM OBRUy09gBSxDdmy9ByMbngfdXmmwas4GhBHtf9KHc7YvLibT8QUisAnC0/PX7r6S8HOY L/DhYjgjzujgqlFuhKvD258ZHxTej4Nlgf3XDWmJAEzK/53UkQ1P/1nYDO+Y/LhbvZia GCgIOu/j/s3MMaEf7Lf/Fs8j8VqfH9Y3QYllCeRCC4TvLAKtyd/WqezipOAh2bjGNHMf UGvqySJ/EGiNTCG1g3ub0dv8AwctiVC5VdDiPZ4BamGr7yA+3V5XS7QmDafzKjrKF6NX YvbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VBZ224FO; 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=pass (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 e21si19758522edv.260.2020.12.28.05.11.50; Mon, 28 Dec 2020 05:12:13 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VBZ224FO; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730958AbgL1NIi (ORCPT + 99 others); Mon, 28 Dec 2020 08:08:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:36316 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730276AbgL1NIg (ORCPT ); Mon, 28 Dec 2020 08:08:36 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id F105F22BED; Mon, 28 Dec 2020 13:07:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609160875; bh=PwJU+LWoKMzrrqcSg5SCHuECKtBSKiHosJWC9FEsgH8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VBZ224FOsMko7DnIXa+hhscC/JNApbcVHcAXAyqRhWZbFp0PX66bnGglhXhcpqbsu wASlQfK1vKrq2rMMnryvlMYpSDn6Ibryblnb3qpiqBG+VObBe0jCoXPFdDQ6A/HxfV jtPUJ1jME1BvXkLUwb5tYBBf1aSThpaNLMM2/7RM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alan Stern , Bui Quang Minh Subject: [PATCH 4.14 025/242] USB: dummy-hcd: Fix uninitialized array use in init() Date: Mon, 28 Dec 2020 13:47:10 +0100 Message-Id: <20201228124905.904471937@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124904.654293249@linuxfoundation.org> References: <20201228124904.654293249@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 @@ -2742,7 +2742,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;