linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Salah Triki <salah.triki@gmail.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>, gregkh@linuxfoundation.org
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] misc: powermate: update the reference count of the usb interface structure
Date: Sat, 24 Jul 2021 22:20:16 +0100	[thread overview]
Message-ID: <20210724212016.GA568154@pc> (raw)

Use usb_get_intf() and usb_put_intf() in order to update the reference
count of the usb interface structure.

Signed-off-by: Salah Triki <salah.triki@gmail.com>
---
 drivers/input/misc/powermate.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/input/misc/powermate.c b/drivers/input/misc/powermate.c
index c4e0e1886061..69dc3347478a 100644
--- a/drivers/input/misc/powermate.c
+++ b/drivers/input/misc/powermate.c
@@ -337,7 +337,7 @@ static int powermate_probe(struct usb_interface *intf, const struct usb_device_i
 		goto fail3;
 
 	pm->udev = udev;
-	pm->intf = intf;
+	pm->intf = usb_get_intf(intf);
 	pm->input = input_dev;
 
 	usb_make_path(udev, pm->phys, sizeof(pm->phys));
@@ -428,6 +428,7 @@ static void powermate_disconnect(struct usb_interface *intf)
 		usb_free_urb(pm->irq);
 		usb_free_urb(pm->config);
 		powermate_free_buffers(interface_to_usbdev(intf), pm);
+		usb_put_intf(pm->intf);
 
 		kfree(pm);
 	}
-- 
2.25.1


             reply	other threads:[~2021-07-24 21:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-24 21:20 Salah Triki [this message]
2021-07-24 23:08 ` Dmitry Torokhov
2021-07-24 23:56   ` Salah Triki
2021-07-25  4:35     ` Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210724212016.GA568154@pc \
    --to=salah.triki@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH] misc: powermate: update the reference count of the usb interface structure' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).