Linux-HyperV Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] uio_hv_generic: add missed sysfs_remove_bin_file
@ 2020-05-07 15:13 Chuhong Yuan
  2020-05-07 16:36 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 2+ messages in thread
From: Chuhong Yuan @ 2020-05-07 15:13 UTC (permalink / raw)
  Cc: K . Y . Srinivasan, Haiyang Zhang, Stephen Hemminger, Wei Liu,
	Greg Kroah-Hartman, linux-hyperv, linux-kernel, Chuhong Yuan

This driver calls sysfs_create_bin_file() in probe, but forgets to
call sysfs_remove_bin_file() in remove.
Add the missed call to fix it.

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
---
 drivers/uio/uio_hv_generic.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/uio/uio_hv_generic.c b/drivers/uio/uio_hv_generic.c
index 3c5169eb23f5..4dae2320b103 100644
--- a/drivers/uio/uio_hv_generic.c
+++ b/drivers/uio/uio_hv_generic.c
@@ -361,6 +361,7 @@ hv_uio_remove(struct hv_device *dev)
 	if (!pdata)
 		return 0;
 
+	sysfs_remove_bin_file(&dev->channel->kobj, &ring_buffer_bin_attr);
 	uio_unregister_device(&pdata->info);
 	hv_uio_cleanup(dev, pdata);
 	hv_set_drvdata(dev, NULL);
-- 
2.26.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] uio_hv_generic: add missed sysfs_remove_bin_file
  2020-05-07 15:13 [PATCH] uio_hv_generic: add missed sysfs_remove_bin_file Chuhong Yuan
@ 2020-05-07 16:36 ` Greg Kroah-Hartman
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2020-05-07 16:36 UTC (permalink / raw)
  To: Chuhong Yuan
  Cc: K . Y . Srinivasan, Haiyang Zhang, Stephen Hemminger, Wei Liu,
	linux-hyperv, linux-kernel

On Thu, May 07, 2020 at 11:13:43PM +0800, Chuhong Yuan wrote:
> This driver calls sysfs_create_bin_file() in probe, but forgets to
> call sysfs_remove_bin_file() in remove.
> Add the missed call to fix it.
> 
> Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
> ---
>  drivers/uio/uio_hv_generic.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/uio/uio_hv_generic.c b/drivers/uio/uio_hv_generic.c
> index 3c5169eb23f5..4dae2320b103 100644
> --- a/drivers/uio/uio_hv_generic.c
> +++ b/drivers/uio/uio_hv_generic.c
> @@ -361,6 +361,7 @@ hv_uio_remove(struct hv_device *dev)
>  	if (!pdata)
>  		return 0;
>  
> +	sysfs_remove_bin_file(&dev->channel->kobj, &ring_buffer_bin_attr);
>  	uio_unregister_device(&pdata->info);
>  	hv_uio_cleanup(dev, pdata);
>  	hv_set_drvdata(dev, NULL);


I'll take this, but it's not always needed as all sysfs files are
removed from the device when it is removed from sysfs anyway.  So this
shouldn't be an issue in a real system.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-07 15:13 [PATCH] uio_hv_generic: add missed sysfs_remove_bin_file Chuhong Yuan
2020-05-07 16:36 ` Greg Kroah-Hartman

Linux-HyperV Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-hyperv/0 linux-hyperv/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-hyperv linux-hyperv/ https://lore.kernel.org/linux-hyperv \
		linux-hyperv@vger.kernel.org
	public-inbox-index linux-hyperv

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-hyperv


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git