From patchwork Fri Nov 29 10:17:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 11266879 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4624D109A for ; Fri, 29 Nov 2019 10:20:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2380E217D6 for ; Fri, 29 Nov 2019 10:20:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575022816; bh=uxDPX9Wv9UMxaKJ4BPCyBDMxbLwdnEATm3Jevf284nA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=dUqa/zcskIXXPZNrBQIeuSx3TdWhswiDCpFky6d3D5PaepJJ34omIE6q2wUIDAmN0 1u1PhT0tEOmYQwB9pANZs/bVFlzEjYlDlLOW5DW9kmkBOfaC6aXRoRpwJJeGmaRdxj uYO5GviFeP1g4Dld0uBcol7ofpg0JaUbSfZxZHtA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726926AbfK2KT6 (ORCPT ); Fri, 29 Nov 2019 05:19:58 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:33777 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726821AbfK2KT5 (ORCPT ); Fri, 29 Nov 2019 05:19:57 -0500 Received: by mail-lj1-f193.google.com with SMTP id t5so31430703ljk.0; Fri, 29 Nov 2019 02:19:56 -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=ZWtVf6zhlqG1yD0jYizMqYkj60ZxzCRmOI8BvxjssGc=; b=fhbxF4eHdeLhdS0M82YeyNiblyRFkdMZePAkVcLiaNr2ywkaFsS2NGxiswI1bY9pQp T/es6mcqh1QwgHBPoUSV69zWz//I4S2mzWH4L0b8KJs1rt3S+DEX2Tnjbj6iMz1GS4kx od+qEeb/A+laRVb0BpNBAmjIgF2LRr0aWANuANU9MX1OIPZ+VT6DY6POX3dX0F471nIr ZgvoTkjNUz9POiI53gcev0b1/I3crDrH8DweizYcFTzm4LxsFDNQanI5N/liJhh3MvX8 r6n4S9GW+g7hF8MQk/1z+RwXKTYsKGY2ZCzrmrnlEytYqAjEbkWw91H1ppBM82oN2o1a 2JSw== X-Gm-Message-State: APjAAAV4vwqIjYTeFvY54qACBuu3Wdf/lnlssWoGUN5T+1ziQ6DLpzhE kEXJjqoXmhDiuYUVHPE6cTc= X-Google-Smtp-Source: APXvYqw4g71C2eRvXHbOV45V30LoE6CF3v9D8rtC47pf6fKiAPEM8X2+iIFTkuBwPRMuxp4Ko7CFJw== X-Received: by 2002:a2e:3313:: with SMTP id d19mr38124589ljc.240.1575022795263; 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 s76sm4550400lje.53.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-0002Ya-AL; Fri, 29 Nov 2019 11:19:56 +0100 From: Johan Hovold To: Greg Kroah-Hartman Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, Johan Hovold , syzbot+35b1c403a14f5c89eba7@syzkaller.appspotmail.com, stable , Hansjoerg Lipp , Tilman Schmidt Subject: [PATCH 1/4] staging: gigaset: fix general protection fault on probe Date: Fri, 29 Nov 2019 11:17:50 +0100 Message-Id: <20191129101753.9721-2-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 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Fix a general protection fault when accessing the endpoint descriptors which could be triggered by a malicious device due to missing sanity checks on the number of endpoints. Reported-by: syzbot+35b1c403a14f5c89eba7@syzkaller.appspotmail.com Fixes: 07dc1f9f2f80 ("[PATCH] isdn4linux: Siemens Gigaset drivers - M105 USB DECT adapter") Cc: stable # 2.6.17 Cc: Hansjoerg Lipp Cc: Tilman Schmidt Signed-off-by: Johan Hovold --- drivers/staging/isdn/gigaset/usb-gigaset.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/staging/isdn/gigaset/usb-gigaset.c b/drivers/staging/isdn/gigaset/usb-gigaset.c index 1b9b43659bdf..5e393e7dde45 100644 --- a/drivers/staging/isdn/gigaset/usb-gigaset.c +++ b/drivers/staging/isdn/gigaset/usb-gigaset.c @@ -685,6 +685,11 @@ static int gigaset_probe(struct usb_interface *interface, return -ENODEV; } + if (hostif->desc.bNumEndpoints < 2) { + dev_err(&interface->dev, "missing endpoints\n"); + return -ENODEV; + } + dev_info(&udev->dev, "%s: Device matched ... !\n", __func__); /* allocate memory for our device state and initialize it */ From patchwork Fri Nov 29 10:17:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 11266877 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2ED77109A for ; Fri, 29 Nov 2019 10:20:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0CF8C2086A for ; Fri, 29 Nov 2019 10:20:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575022811; bh=Us2LR83sqTpDDxH+Vob/8vFqXsuJSQfz1IXYJRDcCJ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=rq1IeBG3VUhzRGKL3HIHifENVaEnX+pi1jXCNKaMG0TepmvziqjvGjFSop6LPSVf3 SPhK9ppvriTR8CZ2e7r6rkcEdRwnyBpC4kMjjEyc4lECLfH1RKC7dl0OHpig5bUL1q eQSSrXxqOOW7ZbRc7H34A0NC2p5s3UnVNREbGfWM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727047AbfK2KUK (ORCPT ); Fri, 29 Nov 2019 05:20:10 -0500 Received: from mail-lf1-f66.google.com ([209.85.167.66]:37017 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726823AbfK2KT6 (ORCPT ); Fri, 29 Nov 2019 05:19:58 -0500 Received: by mail-lf1-f66.google.com with SMTP id b20so22223212lfp.4; Fri, 29 Nov 2019 02:19:56 -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=Vp4HYuwYQHp46lVvTS5GCZ1qqSWfIhgJbhDrfZjhW/6jArG4t4+kPTd7E952raO/Xc 1GZdzL3P9ppH5db5zxNVhzK7sNxXA70vmsQ3YXNn9DydV0th4KziQvKrSfGFlp0Mr3p6 RVEhhj6WYEmb6qyKbSszRtxQfmDz4+QTH97LRV3CS3+wwPhgUFDgWyVBbsANA3MpCmKs qvTDFKhBNt2DhkpteOoJ25xGsiS+3pFDbw0rKFbzTaXNlxMqzuLu5qPyflnxRx5e0Tdl v7YUHU1b8QFLTTAr30mj6xgsSX13plmP+STfzta2Bad4FVrhYDR0M1iC9IjsbyEkfqsL l5SQ== X-Gm-Message-State: APjAAAUsw0HayCMNaDA4iqxwz4uT4D9lE26XXhznQrPKdlEqLmEt+/2L gshWVuRf5LZaJaaTm7tAIFlZCuh3 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 Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, Johan Hovold , stable , Tilman Schmidt 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 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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); From patchwork Fri Nov 29 10:17:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 11266873 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0CDB6139A for ; Fri, 29 Nov 2019 10:20:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DD761217BA for ; Fri, 29 Nov 2019 10:20:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575022806; bh=jAzA4Sfd9bJGOMdJJqTPorOs7dOko/+46Xq2XKJAgSs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=xTXilRTHf1k5ZlpJ7TMrRtWd4Glfvue57SsHySNc6hNrJF0fz9UIfHbyJveuoSn29 0+Mw0VfG1M+G5arXdB1VAdFxdClRZYmxeN+04a8QYOPoMDPWA3qJXqQbSVQkrcWwHp 4pkLhy5I3znaUbdwYYOsTM+3+MIWRCASk0TQ4tYs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726987AbfK2KUA (ORCPT ); Fri, 29 Nov 2019 05:20:00 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:43725 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726857AbfK2KT6 (ORCPT ); Fri, 29 Nov 2019 05:19:58 -0500 Received: by mail-lj1-f193.google.com with SMTP id a13so8232489ljm.10; 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=o4x724Do8urT6OaZpBWsj3Wi4vFYKy69gf8Bt4EpD18=; b=HO35PgUPa0TRQ37VKtDYGBGv9mqy5g14Xy72kKfNNO8QovQcLUCDif+Qyf2p1rGI71 FP7GNLol6qD0rcIYpiYZF7A20A7PvpKIiPC45zZb4OF+nhifOaHryJa9FhQpsjnHozRQ SYpEPE6x/esdujbnizKgofFRG5PVD/loALLqwm53T901DgrtujWi/56pLVhbswbyQw9w BYW8q0X6t6EXX3X4xZvhfaCD0w2z7tMrI8jDcnH1RHYyBrki+YSSXSW/FhErbsS63iwi 5oZkB6pvUdF4ZTmh7QcollIOsPYYeo+oo/Puw1NOZ8SAXrXn28qf8olfpQ5tE+K+kjqa rXXg== X-Gm-Message-State: APjAAAUMSn+EqgJyPjshIAyhFuhGZgGfSRezE21OPMa6FB+r8RY2xsy3 vFg87sg2b3xDkA7wrymWrpE= X-Google-Smtp-Source: APXvYqxUKJ2Ry6AfAHcKf0XABmShcowXhlWbcGdZsRZNCePAZURUZrhHereMSi2W5VFWNaDdMgny5Q== X-Received: by 2002:a2e:8745:: with SMTP id q5mr7995655ljj.208.1575022796310; Fri, 29 Nov 2019 02:19:56 -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 u16sm11279263lfi.36.2019.11.29.02.19.54 (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-0002Yl-F7; Fri, 29 Nov 2019 11:19:56 +0100 From: Johan Hovold To: Greg Kroah-Hartman Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, Johan Hovold Subject: [PATCH 3/4] staging: gigaset: add endpoint-type sanity check Date: Fri, 29 Nov 2019 11:17:52 +0100 Message-Id: <20191129101753.9721-4-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 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Add endpoint type-sanity checks to prevent a warning in USB core on URB submission. Signed-off-by: Johan Hovold --- drivers/staging/isdn/gigaset/usb-gigaset.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/staging/isdn/gigaset/usb-gigaset.c b/drivers/staging/isdn/gigaset/usb-gigaset.c index a84722d83bc6..6c07c8379711 100644 --- a/drivers/staging/isdn/gigaset/usb-gigaset.c +++ b/drivers/staging/isdn/gigaset/usb-gigaset.c @@ -705,6 +705,12 @@ static int gigaset_probe(struct usb_interface *interface, endpoint = &hostif->endpoint[0].desc; + if (!usb_endpoint_dir_out(endpoint) || !usb_endpoint_xfer_bulk(endpoint)) { + dev_err(&interface->dev, "missing bulk-out endpoint\n"); + retval = -ENODEV; + goto error; + } + buffer_size = le16_to_cpu(endpoint->wMaxPacketSize); ucs->bulk_out_size = buffer_size; ucs->bulk_out_epnum = usb_endpoint_num(endpoint); @@ -724,6 +730,12 @@ static int gigaset_probe(struct usb_interface *interface, endpoint = &hostif->endpoint[1].desc; + if (!usb_endpoint_dir_in(endpoint) || !usb_endpoint_xfer_int(endpoint)) { + dev_err(&interface->dev, "missing int-in endpoint\n"); + retval = -ENODEV; + goto error; + } + ucs->busy = 0; ucs->read_urb = usb_alloc_urb(0, GFP_KERNEL); From patchwork Fri Nov 29 10:17:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 11266875 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2C1FC109A for ; Fri, 29 Nov 2019 10:20:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0799E217BC for ; Fri, 29 Nov 2019 10:20:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575022809; bh=eVX+vJs6N1+tiKHgmmWcm/EjVgP+fyNs998hTT0TBWg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=iO+PljJuiWHIE6ph0BZ3AhA7TNYm1RYqPXn3JrjcFg5WyDUk+w4uMf+9nk6vJdXly ClbPEEGpbZwL7D58D3znxy+r1BzgWxLxBzIKQ78xJY3R9bzHa1gF6kF48Lwo9JhG78 qvyFGmYlhaEv8dcVQRIT5hiaOsmJ4XqsEa0XyNjc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726971AbfK2KUA (ORCPT ); Fri, 29 Nov 2019 05:20:00 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:42795 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725892AbfK2KT7 (ORCPT ); Fri, 29 Nov 2019 05:19:59 -0500 Received: by mail-lj1-f194.google.com with SMTP id e28so7210688ljo.9; 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=YQ9NZqfEPBjz3KOdFZmTMVER3EPMPaak6R0HUkbsMbw=; b=oKPgCgbRr8T57X9c/Iq9osWj3YtMrR2v7/VT/uQIioL3DhkTaORhPyTVQXvAOAadu0 wmXpOEFf4jnzNzBn4grJlC7M14SIeAyma8x8+ACkgeTk0chNkzUps/HUuQ2Opb49ILCX SUoVxuNMgE5sjEDMHpH6d6ktmBdWK2hYbXgoa2VWsq7+b/jPDh/9Y46bfq5RKVLjkcfO KkKWpp9h76s5e5cOX7jGROQDu6ftlvGjIIVOfNr/wziM76rMXchEEKgdmoVEpqCo8CEe XnVl7oCXEFamN8O94pLsIh7ISV5LFKvibI1Ht1S9+bLH2xI0Dh1kRCL4c4vZy19ORvB3 lGcw== X-Gm-Message-State: APjAAAUjm9QP28z8/z/ZeIOsQEL1Xlx66Rnox5EZhgrCofF+rFjLTCm5 5h0rlrPMRUdUy0gwS4t8ARniGWOE X-Google-Smtp-Source: APXvYqzJB4YmHHDLdWxGw/gxHtBIsdyjdqqfFfBq0afNUwu5NbJ0VZT2+sgpIvQC3mGQpJOi7q44FA== X-Received: by 2002:a2e:8016:: with SMTP id j22mr989015ljg.24.1575022796898; Fri, 29 Nov 2019 02:19:56 -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 g85sm9990868lfd.66.2019.11.29.02.19.54 (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-0002Yq-Hx; Fri, 29 Nov 2019 11:19:56 +0100 From: Johan Hovold To: Greg Kroah-Hartman Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, Johan Hovold Subject: [PATCH 4/4] staging: gigaset: rename endpoint-descriptor identifier Date: Fri, 29 Nov 2019 11:17:53 +0100 Message-Id: <20191129101753.9721-5-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 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Rename an endpoint-descriptor pointer to shut up a checkpatch warning about a line being over 80 columns, which is bound to generate a bunch of clean up patches otherwise. Signed-off-by: Johan Hovold --- drivers/staging/isdn/gigaset/usb-gigaset.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/staging/isdn/gigaset/usb-gigaset.c b/drivers/staging/isdn/gigaset/usb-gigaset.c index 6c07c8379711..d5fab2ea25b4 100644 --- a/drivers/staging/isdn/gigaset/usb-gigaset.c +++ b/drivers/staging/isdn/gigaset/usb-gigaset.c @@ -652,7 +652,7 @@ static int gigaset_probe(struct usb_interface *interface, struct usb_host_interface *hostif = interface->cur_altsetting; struct cardstate *cs = NULL; struct usb_cardstate *ucs = NULL; - struct usb_endpoint_descriptor *endpoint; + struct usb_endpoint_descriptor *epd; int buffer_size; gig_dbg(DEBUG_ANY, "%s: Check if device matches ...", __func__); @@ -703,17 +703,17 @@ static int gigaset_probe(struct usb_interface *interface, /* save address of controller structure */ usb_set_intfdata(interface, cs); - endpoint = &hostif->endpoint[0].desc; + epd = &hostif->endpoint[0].desc; - if (!usb_endpoint_dir_out(endpoint) || !usb_endpoint_xfer_bulk(endpoint)) { + if (!usb_endpoint_dir_out(epd) || !usb_endpoint_xfer_bulk(epd)) { dev_err(&interface->dev, "missing bulk-out endpoint\n"); retval = -ENODEV; goto error; } - buffer_size = le16_to_cpu(endpoint->wMaxPacketSize); + buffer_size = le16_to_cpu(epd->wMaxPacketSize); ucs->bulk_out_size = buffer_size; - ucs->bulk_out_epnum = usb_endpoint_num(endpoint); + ucs->bulk_out_epnum = usb_endpoint_num(epd); ucs->bulk_out_buffer = kmalloc(buffer_size, GFP_KERNEL); if (!ucs->bulk_out_buffer) { dev_err(cs->dev, "Couldn't allocate bulk_out_buffer\n"); @@ -728,9 +728,9 @@ static int gigaset_probe(struct usb_interface *interface, goto error; } - endpoint = &hostif->endpoint[1].desc; + epd = &hostif->endpoint[1].desc; - if (!usb_endpoint_dir_in(endpoint) || !usb_endpoint_xfer_int(endpoint)) { + if (!usb_endpoint_dir_in(epd) || !usb_endpoint_xfer_int(epd)) { dev_err(&interface->dev, "missing int-in endpoint\n"); retval = -ENODEV; goto error; @@ -744,7 +744,7 @@ static int gigaset_probe(struct usb_interface *interface, retval = -ENOMEM; goto error; } - buffer_size = le16_to_cpu(endpoint->wMaxPacketSize); + buffer_size = le16_to_cpu(epd->wMaxPacketSize); ucs->rcvbuf_size = buffer_size; ucs->rcvbuf = kmalloc(buffer_size, GFP_KERNEL); if (!ucs->rcvbuf) { @@ -754,10 +754,10 @@ static int gigaset_probe(struct usb_interface *interface, } /* Fill the interrupt urb and send it to the core */ usb_fill_int_urb(ucs->read_urb, udev, - usb_rcvintpipe(udev, usb_endpoint_num(endpoint)), + usb_rcvintpipe(udev, usb_endpoint_num(epd)), ucs->rcvbuf, buffer_size, gigaset_read_int_callback, - cs, endpoint->bInterval); + cs, epd->bInterval); retval = usb_submit_urb(ucs->read_urb, GFP_KERNEL); if (retval) {