From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C81CD3812C2 for ; Mon, 6 Jul 2026 15:11:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783350670; cv=none; b=Fk0mP6tXJBtD0j3MWNy4FCD4ESoRqurZnaTN099IlexCJhycJPDpSlg/C8PzHOik65vdyyIDODPAb6wq0lipZNGCjc+PfdVVXJhfBZieE60DfzJzUUuQsB1QVW2LBVVykHM8UYTHEJRGJF5JWhINnrIMTjqg+6SCILwiPzkz1RQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783350670; c=relaxed/simple; bh=DC8hbtn49OkRdhMEpTeVtkgA5St46LFuImCP51O/Z7c=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=FPfsIQ4KNhYA26dDwdZ0Gt1L2vL/AGJxMry6ByeaBd0sbzNJeOpzQd3ar6OROKHbPd+NiCdpGOkYNYofP03c50z09g5vlbgJT0Eva/R6MauSuFtOQIWN74dstVQb+/uY7xZ88r54hFRrwqTySvFJuP1kO7+WmINcTfSjH4toemw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=byTTlJHJ; arc=none smtp.client-ip=209.85.214.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="byTTlJHJ" Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-2cc8bc9d222so15315425ad.1 for ; Mon, 06 Jul 2026 08:11:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783350668; x=1783955468; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=YvJnbKtZ9JQUQxlIoTBWahfF5cHSq4G8K3OUqqfWB8Q=; b=byTTlJHJRNARRkFIETilzDPcAeEQBQdYdEGbm1zWeCz246q6JVUmemJSmgUxHJ1HYV L/DJWoQ+4BmB8YBclr6iQ6hA7IcfGSCKs0YKbOi4Yh8k5lFDeFAWBjIhSxMFWGaSxQEb juPtqICSIHXkyY6wdB4rrR51y6jIdMPHBwaT8v+YE/Leo7SEWm8xC+NC5T4bOvG1Eha5 0zdjUg1JAQXbVVtYDgYyIhtmDGJZj0cPtNZssSZEYs+HjHFZ7CVoukcq6SodL8AXw6cw +irZhR7m4Prv+8sQzl2vTiAtzRiImqaI4TY4uap+4shgjJFPX/bZR4MTZfmDM3kOJKhQ rgUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783350668; x=1783955468; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=YvJnbKtZ9JQUQxlIoTBWahfF5cHSq4G8K3OUqqfWB8Q=; b=hPaHaFEsTETy2M21KKTAuFCVU2sj0ffwtlfJrRyjg0La7xChhUlv7V8fRnCDgmd0iK SJMVU6/HzJhwBVHMDkebmVKcQGNZVmmL48qhQ63iWOlayinLXdqfpmxhOPE6Ttw85zs3 d9kFngBB0XacFS+kZPDQjpYnARsYfaYM++y3b/ziIhPGHLjjc7r9NYZmSjxBQCEPoIVJ d/BV7ycUKxGV38OA1P32LhkmQzgQWcAH0klWrVtUVe0XOWbHd91wibgfGPwjxFirs/vh /NwVJdcT8mxDUQN2I3MJUb771qLZPvyIOkZz40OJ7N312V3Q+BtT4/jEqWC4pKj0ysel UtfQ== X-Forwarded-Encrypted: i=1; AHgh+RrjfjPNbkjr+Z2umjEO2rL/97q78wzrKJIPQjEN96DlKk3IjeSiv/dJloBJSYIvnzMhMH1EX7E3XAemmfs=@vger.kernel.org X-Gm-Message-State: AOJu0YwZk0SOAUOad9oxwr4Bkr+v6pa0njgVE14PxzhfgMzuYrvLoffd /cGaWYHT4XDzdQqWFs5bdnYrK8gSYXLgmTp45821a75zbD72BYXxR04= X-Gm-Gg: AfdE7cm7agNE/vhlLITzkkKY0e2JKSN1GpjM0q8g6QkQE/ECG2nPWiTg1KYN9INqy8o kb+ufZsfnzLOsABExdDmf4FATSC1ZjQx//ezLbIyQYXQ0foJTiRKyfEfeggHhGLCmTBGkQ0Lk4s wW/Ng0LdQifpT6dA78aMGC2anbhdLQpxVwdrU97ZI32Ggi3PC+j6BZwWdaMDMwpr3EHg7eBKLeS oBE4B8tXbCuKU9F7eVDdGXscJUXL8r9UFL2YIfTJFaxK//bKkn2MELE9suWXhqvSw2xPnHn222I 9x1KncXUmzA61xv9vPuvv/Bt3xDlTuXKcDEMIy/t2a8ZpUEu58lhANCUG5gLC4ps6VgDvE1MEzd 6xg11lcOE9ND4ST5vzCJEP723bOgM8ko7p2izpoEz8i5rfhV/RgrcaKhwq5FcAOzjQkxgwsvGPb fsW8HK6c0pwuznL2s65tHAqopLODEe3TckWjSuZQn91yTER9Qo6Y3yNc12N+rH/v9yY9h6JEpuV t1Iv+t2mrjLMFzR8bR2AOrcgerTQuKyFs+jaHaswR5Df/SEvQ== X-Received: by 2002:a17:902:d4c1:b0:2c9:97a8:8c1b with SMTP id d9443c01a7336-2ccbf183a00mr9819105ad.46.1783350668084; Mon, 06 Jul 2026 08:11:08 -0700 (PDT) Received: from localhost.localdomain ([14.5.152.27]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cad78a9f83sm52218885ad.83.2026.07.06.08.11.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Jul 2026 08:11:07 -0700 (PDT) From: Myeonghun Pak To: Greg Kroah-Hartman Cc: Oliver Neukum , Alex Henrie , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Myeonghun Pak , Ijae Kim Subject: [PATCH v2] USB: misc: uss720: unregister parport on probe failure Date: Tue, 7 Jul 2026 00:10:49 +0900 Message-Id: <20260706151049.63470-1-mhun512@gmail.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit uss720_probe() registers a parport before reading the 1284 register used to detect unsupported Belkin F5U002 adapters. If get_1284_register() fails, the error path drops the driver private data and the USB device reference, but leaves the parport device registered. Leaving the port registered is more than a private allocation leak: parport_register_port() has already reserved a parport number and registered the parport bus device, while pp->private_data still points at the private data that the common error path is about to release. Undo the pre-announce registration in the get_1284_register() failure branch before jumping to the common private-data cleanup path. Clear priv->pp first, matching the disconnect path and avoiding a stale pointer in the private data. This issue was identified during our ongoing static-analysis research while reviewing kernel code. Fixes: 3295f1b866bf ("usb: misc: uss720: check for incompatible versions of the Belkin F5U002") Cc: stable@vger.kernel.org Co-developed-by: Ijae Kim Signed-off-by: Ijae Kim Signed-off-by: Myeonghun Pak --- Changes in v2: - Move the parport cleanup to the get_1284_register() failure branch, as suggested by Alex. - Clarify the visible stale registered-port effect. drivers/usb/misc/uss720.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/usb/misc/uss720.c b/drivers/usb/misc/uss720.c index a8af7615b1..bd099cd8c5 100644 --- a/drivers/usb/misc/uss720.c +++ b/drivers/usb/misc/uss720.c @@ -735,8 +735,11 @@ static int uss720_probe(struct usb_interface *intf, * here. */ ret = get_1284_register(pp, 0, ®, GFP_KERNEL); dev_dbg(&intf->dev, "reg: %7ph\n", priv->reg); - if (ret < 0) + if (ret < 0) { + priv->pp = NULL; + parport_del_port(pp); goto probe_abort; + } ret = usb_find_last_int_in_endpoint(interface, &epd); if (!ret) { -- 2.47.1