Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2683899pxj; Mon, 31 May 2021 08:11:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0I1NvKW8WeAjSwheo0pw323sDDnCowtRMm9IBQMrPBljzoN4jTCnTyz0L+XzWoZWHTdqz X-Received: by 2002:a5d:94d5:: with SMTP id y21mr17486831ior.110.1622473900006; Mon, 31 May 2021 08:11:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622473899; cv=none; d=google.com; s=arc-20160816; b=Mtf62ix7Pj+RwNcn9fWDZlYVTVGhPAAXFbea67TIlNS6+dt3gN2LzaLG1NIabZEvrZ c43bnOVEQ2b3h3vvKFsaBLZlfZ5aUuX5k3jXn6bitcKIziBsq4O8FIOz17Cy2NfX01BP VKS1LtJYvIkiWMy4X7tWepvZd79W3FsEZTG5tn6qN29iRNhTBNVWCYIOwNxa0js7s9kQ ru6SiE6DjQ5z1KE8otnTL2srELLxAjIIs2SuddpRoVVu9dZL0HYr5QR9W2RQWvzD3wWk w2Xmw1h59QOYZzAv6/hhueziHAujQC0lCU2DqkZIaycFrZYOfPRewJIsiLGDTzQa5Rlb /7Cg== 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=2bY76clQ1mI27knteiLzbIHhw5rlWC6zK5QCHXRcw7Y=; b=uZXIahSD6yZty3STcoD3Xj1TimGFZRqVXnBF4genB10bMPgWBhHGVRZQfbEzpf+0Dp 0jg7eoSPNlWmGmhlpLbk957CfJeRO6g0z/4XBP/v2A4Hkfk5vP8tzBHjxct5O/V+Cgt4 rLZLLrvLtf6mcTSYDmurn6rfaYPPqOCDZvrvFBv0l7y4Be+ita9eplPahANoetNDjM/1 Wx5p2RKn5xvfrHfKw4nFaGHLY8PrU1Peo9nrrKQcHpp4S7U8XP8obieLEL8VZH+eUWgC vWYseQ5P3XTqEGq830AjwAZVKJDucX/D1cm54k/dxkzNDsJ7PI46ruIfqOzNeA2bsg5r 1mPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dOk8hYLW; 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 c1si385094ilm.49.2021.05.31.08.11.26; Mon, 31 May 2021 08:11:39 -0700 (PDT) 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=dOk8hYLW; 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 S233549AbhEaPMU (ORCPT + 99 others); Mon, 31 May 2021 11:12:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:40994 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233306AbhEaOLB (ORCPT ); Mon, 31 May 2021 10:11:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B36ED61008; Mon, 31 May 2021 13:40:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468457; bh=YkqUDYWS6J6RK4cCwoTYGe+hTHoCWzpzNwFSw0XN9SA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dOk8hYLWqr3fcZrC02l7rNlcf77IsGwtj+jpNHmM+d5n+5d6w6osOE/dAGsKH7ZHQ 26fKfyoZCiSAOqNK7e45dmpBWkivOzgAp7imM+tdIrUKqyw1vN7vTKYRb+GlVYoPvP +RVHnOYJeBsokYETSZnQ4weMEIcxIUuDMKWsEOfQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johan Hovold , Dan Carpenter , "David S. Miller" Subject: [PATCH 5.10 249/252] net: hso: bail out on interrupt URB allocation failure Date: Mon, 31 May 2021 15:15:14 +0200 Message-Id: <20210531130706.452230115@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130657.971257589@linuxfoundation.org> References: <20210531130657.971257589@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: Johan Hovold commit 4d52ebc7ace491d58f96d1f4a1cb9070c506b2e7 upstream. Commit 31db0dbd7244 ("net: hso: check for allocation failure in hso_create_bulk_serial_device()") recently started returning an error when the driver fails to allocate resources for the interrupt endpoint and tiocmget functionality. For consistency let's bail out from probe also if the URB allocation fails. Signed-off-by: Johan Hovold Reviewed-by: Dan Carpenter Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/usb/hso.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c @@ -2635,14 +2635,14 @@ static struct hso_device *hso_create_bul } tiocmget->urb = usb_alloc_urb(0, GFP_KERNEL); - if (tiocmget->urb) { - mutex_init(&tiocmget->mutex); - init_waitqueue_head(&tiocmget->waitq); - } else - hso_free_tiomget(serial); - } - else + if (!tiocmget->urb) + goto exit; + + mutex_init(&tiocmget->mutex); + init_waitqueue_head(&tiocmget->waitq); + } else { num_urbs = 1; + } if (hso_serial_common_create(serial, num_urbs, BULK_URB_RX_SIZE, BULK_URB_TX_SIZE))