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=-10.0 required=3.0 tests=INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 2EC14C43141 for ; Fri, 29 Nov 2019 10:20:04 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0DD3D217BA for ; Fri, 29 Nov 2019 10:20:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0DD3D217BA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=driverdev-devel-bounces@linuxdriverproject.org Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id CD2A287DAE; Fri, 29 Nov 2019 10:20:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vhaXzgAh29Wu; Fri, 29 Nov 2019 10:20:01 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 9C15487D6F; Fri, 29 Nov 2019 10:20:01 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 312241BF349 for ; Fri, 29 Nov 2019 10:19:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 2DF7386C04 for ; Fri, 29 Nov 2019 10:19:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9QJ7UdAXwFPW for ; Fri, 29 Nov 2019 10:19:58 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-lf1-f65.google.com (mail-lf1-f65.google.com [209.85.167.65]) by fraxinus.osuosl.org (Postfix) with ESMTPS id A007986BC9 for ; Fri, 29 Nov 2019 10:19:57 +0000 (UTC) Received: by mail-lf1-f65.google.com with SMTP id r15so19282403lff.2 for ; Fri, 29 Nov 2019 02:19:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rl1LB5EX7oIVC0mGuDqRbEVhDWig1nq2VNrs1gvJuaw=; b=ou5kzYhUOQCkQT8iuielE2ILEQ5qNjDAbb8eXmrSLN986J2dIyzwSfJHBlXKECERpN Uo4VmV5xzg5UJ3XMoh5n3OnZ9GHFlDUWBqcWsreFR9i2RnQqp/WMD1r8FdUBSHu+lCj2 urJmVsL0xFFzqKjkZwM53XP+Dc3nyOZa1OMdrae2IA1nmJDOKdYmQA/Jr/gs/ybqzU52 scBYPY//gDlWh9K0ekAazQUF0bFBAOE7GI2gtgtikVDCIvo30V1JO4bEwCksFnRn1O3d nl3GxMYNFvwLpKZcPKiXgj8sn9bxJpFHMtcz/VsxdVjDzcBOgc29YD+vSynYrO+qMgwU +WOg== X-Gm-Message-State: APjAAAWsJe+4cCzJykM5OA7F8BO+rYSeVXwevOK2qUlZyvymT1k5Am3s DU9EGWXxz97YNXIfogiQyIg= X-Google-Smtp-Source: APXvYqwxcevyF+Crh369dU5ipDZwFgUk1/YR1kPM4h38HLel3dEEONpTEAS1i786gMXyLtZ3H5rqHA== X-Received: by 2002:ac2:5626:: with SMTP id b6mr5692138lff.74.1575022795839; Fri, 29 Nov 2019 02:19:55 -0800 (PST) Received: from xi.terra (c-14b8e655.07-184-6d6c6d4.bbcust.telenor.se. [85.230.184.20]) by smtp.gmail.com with ESMTPSA id o9sm3416079ljg.56.2019.11.29.02.19.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Nov 2019 02:19:54 -0800 (PST) Received: from johan by xi.terra with local (Exim 4.92.3) (envelope-from ) id 1iadNU-0002Yg-Cw; Fri, 29 Nov 2019 11:19:56 +0100 From: Johan Hovold To: Greg Kroah-Hartman Subject: [PATCH 2/4] staging: gigaset: fix illegal free on probe errors Date: Fri, 29 Nov 2019 11:17:51 +0100 Message-Id: <20191129101753.9721-3-johan@kernel.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191129101753.9721-1-johan@kernel.org> References: <20191129101753.9721-1-johan@kernel.org> MIME-Version: 1.0 X-BeenThere: driverdev-devel@linuxdriverproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, stable , Johan Hovold , Tilman Schmidt Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" 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 --- drivers/staging/isdn/gigaset/usb-gigaset.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/staging/isdn/gigaset/usb-gigaset.c b/drivers/staging/isdn/gigaset/usb-gigaset.c index 5e393e7dde45..a84722d83bc6 100644 --- a/drivers/staging/isdn/gigaset/usb-gigaset.c +++ b/drivers/staging/isdn/gigaset/usb-gigaset.c @@ -571,8 +571,7 @@ static int gigaset_initcshw(struct cardstate *cs) { 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; @@ -584,9 +583,6 @@ static int gigaset_initcshw(struct cardstate *cs) 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); -- 2.24.0 _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel