From mboxrd@z Thu Jan 1 00:00:00 1970 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=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 EC79BC2D0C1 for ; Thu, 19 Dec 2019 18:45:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C00A22465E for ; Thu, 19 Dec 2019 18:45:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576781156; bh=U+Zy8WDW51twCqB13+h4TM2bIhnae75Z5rp9vowzhX4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Pq7OQPyRjWq4Qn0N5JCt+yVOl2Y2EHcH52DokZe8XNCstk3y64HeZkAEH6TxRuEpb GKCflc3wL5bK4dkTdsigvivcgrUNDvV/Ks0m3qskoPOnRxa2LimqiVbSMiE8iC+Ats a8k7flFhDANTGCes4cJHwU/5nP1l0ixKEUcZgeYI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728454AbfLSSpw (ORCPT ); Thu, 19 Dec 2019 13:45:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:38340 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729248AbfLSSpv (ORCPT ); Thu, 19 Dec 2019 13:45:51 -0500 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 31FC0206D7; Thu, 19 Dec 2019 18:45:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576781150; bh=U+Zy8WDW51twCqB13+h4TM2bIhnae75Z5rp9vowzhX4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pZi1pm/znQASTVMB+rxeBGfs6N+/r1auTdEsqMn3REdpGdrUgbqYqEb6oho9vPerB o6LjizuE8qt8kTy+cpjG1Pws6TCNCcpAOd2zuHuGdv7s//k8aBvEWgacqBA6lHTVhP JfLlKvL03ncx2y9yJ+GyJCcZU3tawSRcmu1J6ktM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tilman Schmidt , Johan Hovold Subject: [PATCH 4.9 103/199] staging: gigaset: fix illegal free on probe errors Date: Thu, 19 Dec 2019 19:33:05 +0100 Message-Id: <20191219183220.597771631@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191219183214.629503389@linuxfoundation.org> References: <20191219183214.629503389@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Johan Hovold commit 84f60ca7b326ed8c08582417493982fe2573a9ad upstream. The driver failed to initialise its receive-buffer pointer, something which could lead to an illegal free on late probe errors. Fix this by making sure to clear all driver data at allocation. Fixes: 2032e2c2309d ("usb_gigaset: code cleanup") Cc: stable # 2.6.33 Cc: Tilman Schmidt Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20191202085610.12719-3-johan@kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/isdn/gigaset/usb-gigaset.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) --- a/drivers/isdn/gigaset/usb-gigaset.c +++ b/drivers/isdn/gigaset/usb-gigaset.c @@ -574,8 +574,7 @@ static int gigaset_initcshw(struct cards { struct usb_cardstate *ucs; - cs->hw.usb = ucs = - kmalloc(sizeof(struct usb_cardstate), GFP_KERNEL); + cs->hw.usb = ucs = kzalloc(sizeof(struct usb_cardstate), GFP_KERNEL); if (!ucs) { pr_err("out of memory\n"); return -ENOMEM; @@ -587,9 +586,6 @@ static int gigaset_initcshw(struct cards ucs->bchars[3] = 0; ucs->bchars[4] = 0x11; ucs->bchars[5] = 0x13; - ucs->bulk_out_buffer = NULL; - ucs->bulk_out_urb = NULL; - ucs->read_urb = NULL; tasklet_init(&cs->write_tasklet, gigaset_modem_fill, (unsigned long) cs);