linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Salah Triki <salah.triki@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Fabio Aiuto <fabioaiuto83@gmail.com>,
	Ross Schmidt <ross.schm.dev@gmail.com>,
	Marco Cesati <marcocesati@gmail.com>,
	Brother Matthew De Angelis <matthew.v.deangelis@gmail.com>,
	"Gustavo A. R. Silva" <gustavoars@kernel.org>,
	Ivan Safonov <insafonov@gmail.com>
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: [PATCH] tablet: acecad: update the reference count of the usb interface structure
Date: Sat, 24 Jul 2021 21:55:42 +0100	[thread overview]
Message-ID: <20210724205542.GA549014@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/tablet/acecad.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/input/tablet/acecad.c b/drivers/input/tablet/acecad.c
index a38d1fe97334..85fe134a30ee 100644
--- a/drivers/input/tablet/acecad.c
+++ b/drivers/input/tablet/acecad.c
@@ -151,7 +151,7 @@ static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_
 		goto fail2;
 	}
 
-	acecad->intf = intf;
+	acecad->intf = usb_get_intf(intf);
 	acecad->input = input_dev;
 
 	if (dev->manufacturer)
@@ -236,6 +236,9 @@ static void usb_acecad_disconnect(struct usb_interface *intf)
 	input_unregister_device(acecad->input);
 	usb_free_urb(acecad->irq);
 	usb_free_coherent(udev, 8, acecad->data, acecad->data_dma);
+
+	usb_put_intf(acecad->intf);
+
 	kfree(acecad);
 }
 
-- 
2.25.1


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

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-24 20:55 Salah Triki [this message]
2021-07-27 12:37 ` Dan Carpenter
2021-07-29  0:54   ` Salah Triki
2021-07-29  8:31     ` Dan Carpenter

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=20210724205542.GA549014@pc \
    --to=salah.triki@gmail.com \
    --cc=fabioaiuto83@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=gustavoars@kernel.org \
    --cc=insafonov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=marcocesati@gmail.com \
    --cc=matthew.v.deangelis@gmail.com \
    --cc=ross.schm.dev@gmail.com \
    --subject='Re: [PATCH] tablet: acecad: 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
on how to clone and mirror all data and code used for this inbox