Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp1381067ybj; Fri, 20 Sep 2019 09:31:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqww75UABB9MdD2IrKyY7qwBFbSYLwGsX74bXcDJO+Mhe5Z0oNj+D2KvWZ6BKy2buHcpyP8Z X-Received: by 2002:a17:906:4801:: with SMTP id w1mr11950811ejq.245.1568997105128; Fri, 20 Sep 2019 09:31:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568997105; cv=none; d=google.com; s=arc-20160816; b=uPM0Kcq5kfIbZdFjO0CRV5shySc4ND2iqaCfJii1MUb5Ew2ylgxmEOPeT1+16vyTeo wva5F5S7kbtXuUcS3QvTtuOvuFT87+y57sQ4x0YPjte2/JSdVEhk3YGLs9gxZgEdnRUz pLt90bndQZZ+CEW2VztcE+rT0Tzri+qw3kEVKhzVSi4SjpzTdeziK6PJnuHvdQ9gDDQV tjjWqW/WNvlUPq7Q5WgV8HahLLCFT3ynBjejLBlBwj0xXTW4ssCtb+m8vNC+fXqku1iU 28BEyBf6VTzW+uWuPJMxdItHRlkzzvQHhjdbLd/jLC3loJrhK2LtbQ/WZUShS93t9tbb sn8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:message-id:date:subject:cc:from :dkim-signature; bh=sq73DcwGjyNmmgxGHw+k0dldxyOr7gBfelRaWt6f/sI=; b=HebahIoZJqJykwwgjhCzjnU1dbCJrO62Ywglww4+ZcBb9I1e7lsowE1DlnCYCcPe+a Gk6zPvLIOgda83owddLTm6PcsDb1I7JTf0iisfXzN2s8a9AagZh2xBQ2IpjaAweD/+J4 X+6eMCBq6OwGDlhtm4R7i0OZSqRY1lzx5mvwKLiSY7uEGi7FcVwmhRS0CtWgsEObu3d0 XIuJEL+7LprUEXWis0zUFBD5uosbLfWaHxrH1GfzXuBV/Hwd9tUJdSqQ4P+HOz0sjoix ebWcRI9clNE4W5TcYh1K49aYKlr9J/lRya1cjK5yMJjK1l9KUJKWW6vulsh3Vr6gt/pR c/1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=mU4mom41; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e20si1351686ejl.225.2019.09.20.09.31.21; Fri, 20 Sep 2019 09:31:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=mU4mom41; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394721AbfITCo5 (ORCPT + 99 others); Thu, 19 Sep 2019 22:44:57 -0400 Received: from mail-io1-f65.google.com ([209.85.166.65]:33290 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388350AbfITCo4 (ORCPT ); Thu, 19 Sep 2019 22:44:56 -0400 Received: by mail-io1-f65.google.com with SMTP id m11so12846595ioo.0; Thu, 19 Sep 2019 19:44:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=sq73DcwGjyNmmgxGHw+k0dldxyOr7gBfelRaWt6f/sI=; b=mU4mom415tumOzOlJX5UYVvszXzNI8OeaB9j5CpxyZiC2hZczbAeYMRxgZ2wdNp1Hb e0/S4Jr5p69syNrqQjw78QYV1TCAJbNxLiPKQx0zI38u5U003BD+e+YUVOL3FtPGwFi5 1Vl5j/WRznRIe7aRxZBUnewmy6+lsVRp7xy4XAeHhsIeCJp3X9p2oBnvNA13NtXhcmtR 3ISLKBi0tuAyGTckZoXvDAblKVIMHsGPVVSGcEPfA2mWiD0heol4yLiLoloKxv4cVgko SYLvGAyGJn1mB/T7D85zgvoFzD9uyiw64xSHQB8Yl6am1d4W/3PS+OjylC1pzKWSyN34 d71A== 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; bh=sq73DcwGjyNmmgxGHw+k0dldxyOr7gBfelRaWt6f/sI=; b=jBYBoEfNQN5JKwJXRqjFxyQNCgsyYDLqJ/Y7N3ICIcjJVsMcDA7EsAvEoJMe5DG+3B Vu9Q8wCKefUKEr6yX2Shz2YfwFpfczqTT7jG8UDvgb2Sye+ccgPvQtIhI0i3WbvGeUWo DNVA1aQ92stajVyyyNThq6mXXpuue+YYLYv/1nn2/JC69dWf/ubwFNcJTCBWFJbBh5Ab lGDPJCLGIsIh1Yd15tlCc9uWwhWyK68QH0xwY0cW9p7u3WWNf5Oi75ex/ixQqXk4GLO4 +i67tyzMXdgco9a5hchLx71FWqmxNsAHUEIld7qSezUOpY7E2SXFof6Uk3XQY9KftVWg z1uA== X-Gm-Message-State: APjAAAXf7lzk6y4UeYkyX6eW1xHEvc2atjYFrpiv+ubgbxOxjwQV+zL/ f+XPqfr0nHjIqNIybsLssD4= X-Received: by 2002:a6b:254:: with SMTP id 81mr16130169ioc.17.1568947495860; Thu, 19 Sep 2019 19:44:55 -0700 (PDT) Received: from cs-dulles.cs.umn.edu (cs-dulles.cs.umn.edu. [128.101.35.54]) by smtp.googlemail.com with ESMTPSA id b8sm453375ior.49.2019.09.19.19.44.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Sep 2019 19:44:55 -0700 (PDT) From: Navid Emamdoost Cc: emamd001@umn.edu, smccaman@umn.edu, kjlu@umn.edu, Navid Emamdoost , Wolfgang Grandegger , Marc Kleine-Budde , "David S. Miller" , Greg Kroah-Hartman , Alexios Zavras , Allison Randal , Thomas Gleixner , linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] can: gs_usb: prevent memory leak Date: Thu, 19 Sep 2019 21:44:38 -0500 Message-Id: <20190920024445.28214-1-navid.emamdoost@gmail.com> X-Mailer: git-send-email 2.17.1 To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In gs_can_open if usb_submit_urb fails the allocated urb should be released. Signed-off-by: Navid Emamdoost --- drivers/net/can/usb/gs_usb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/can/usb/gs_usb.c b/drivers/net/can/usb/gs_usb.c index bd6eb9967630..2f74f6704c12 100644 --- a/drivers/net/can/usb/gs_usb.c +++ b/drivers/net/can/usb/gs_usb.c @@ -623,6 +623,7 @@ static int gs_can_open(struct net_device *netdev) rc); usb_unanchor_urb(urb); + usb_free_urb(urb); break; } -- 2.17.1