Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2713309pxj; Mon, 31 May 2021 08:54:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxhPPHzLRB10iZHMlgIh8GkdNWhmDi9dednCwl/sxuv3gk14aKc0LEwWuRVdX6XAMRyHggo X-Received: by 2002:a17:906:7052:: with SMTP id r18mr23308972ejj.449.1622476455395; Mon, 31 May 2021 08:54:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622476455; cv=none; d=google.com; s=arc-20160816; b=chTH30HGtyyUC675errCkZwnIYeeLVV3WfVGj5Cz5UMgxxkcgrmp+wyoTnNg85GMn0 YhPdqmPQNcrR3/qtNg8JhlkEMim4MTd5+iPvTtS6BiIlm5NscZyI5rtL0VPxk6p10mXq 1ChCO8qulL/RYJPGbb7BOmQtk2dicCeqYCWlysaf7FZH0gVJvA0Vqyc4P6K6B8aArE3B ZsbxwSZsFTf2ElkhYX5hZVLB0v3WmPemtERGh6UyxoO7J/XCpC6zvFQuql5DxMmGlfyb nLUQ0glnov1osi2EenJUOeJLZdMDfX0lDCzdLHimkYNia4jeKlAaVTqgaWtWBGmWcYHK GBiw== 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=O5w0iOf3y9dRc5yQwUoV4WHSI2rylLkO4P6Ih5I4p2M=; b=kqe6X+5xJYy3OIuIZr5aEnpn/aV4P3ww/TXyJc95HENV8sdPoO8VsBR+AmgDxyVmjo rfd9aT+0sbuYAy9MuQsZPI9ML1CnwRdA9Njz8ox+0y5PpyWbhIDQlD7heYFBsaMnTH/h JgJaCkQWxpjKQAvIhu126ywBR7XbNYEybfZ3IkExW/7Cn37JwRCt1n4hUtAqE7dvKvh7 SFSYZZB/sE6DngnIWXoKo+2k0vBMMot+Jhh0h2QnPS86uk3GShDZDXKJ07/3MhsXTj1G kGVmRuJ4WK2hfodQMHbx4siE0jT/WymT72ARo4ed6vgqLABjLd3vBdm673LZT8F+G7Kf 9Hmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WNt7FJlO; 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 g21si3985831ejb.437.2021.05.31.08.53.52; Mon, 31 May 2021 08:54:15 -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=WNt7FJlO; 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 S233780AbhEaPxk (ORCPT + 99 others); Mon, 31 May 2021 11:53:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:56130 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233834AbhEaO33 (ORCPT ); Mon, 31 May 2021 10:29:29 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7C43661C26; Mon, 31 May 2021 13:48:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468909; bh=+hijx25d/CrEHAhv9G0Cby+FqFBEyll5EZ+v9ScxMVY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WNt7FJlOtk1+SEpk2jleDjpSy9HqPqw/p+MofhdRmHv6Oqj4Vz93wHbLfr+kfng2W F4fwtMcvBtrwJ6qFiayK5+c4U05Sr5sK2ikEgYdsFU2HyQfHbbYEygwqmwqSNwzV6n KkDX6YbUXggsdPqa+0x0QK5exmIZTwX2w1nkYEBc= 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.4 175/177] net: hso: bail out on interrupt URB allocation failure Date: Mon, 31 May 2021 15:15:32 +0200 Message-Id: <20210531130653.981273544@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130647.887605866@linuxfoundation.org> References: <20210531130647.887605866@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 @@ -2636,14 +2636,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))