lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161019132622.GN2467@localhost>
Date:   Wed, 19 Oct 2016 18:56:22 +0530
From:   Vinod Koul <vinod.koul@...el.com>
To:     Sinan Kaya <okaya@...eaurora.org>
Cc:     dmaengine@...r.kernel.org, timur@...eaurora.org,
        cov@...eaurora.org, linux-arm-msm@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] dmaengine: qcom_hidma: cleanup sysfs entries during
 remove

On Thu, Oct 06, 2016 at 07:23:09PM -0400, Sinan Kaya wrote:
> The 4.8-rc8 kernel is printing duplicate file entry warnings while removing
> the HIDMA object. This is caused by stale sysfs entries remaining from the
> previous execution.
> 
> _sysfs_warn_dup+0x5c/0x78
>  sysfs_add_file_mode_ns+0x13c/0x1c0
>  sysfs_create_file_ns+0x2c/0x40
>  device_create_file+0x54/0xa0
>  hidma_probe+0x7c8/0x808
> 
> Create hidma_sysfs_init and hidma_sysfs_uninit functions and call them from
> the probe and remove path. To do proper clean up, adding the attrs object
> to the device data structure to keep it around until remove call is made.
> 
> Signed-off-by: Sinan Kaya <okaya@...eaurora.org>
> ---
>  drivers/dma/qcom/hidma.c | 31 +++++++++++++++++++++++++------
>  drivers/dma/qcom/hidma.h |  3 +++
>  2 files changed, 28 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/dma/qcom/hidma.c b/drivers/dma/qcom/hidma.c
> index f4fe4ee..414ea12 100644
> --- a/drivers/dma/qcom/hidma.c
> +++ b/drivers/dma/qcom/hidma.c
> @@ -578,8 +578,17 @@ static ssize_t hidma_show_values(struct device *dev,
>  	return strlen(buf);
>  }
>  
> -static int hidma_create_sysfs_entry(struct hidma_dev *dev, char *name,
> -				    int mode)
> +static int hidma_sysfs_uninit(struct hidma_dev *dev)
> +{
> +	if (!dev->chid_attrs)
> +		return -ENOMEM;

why is this check required? Probe would fail in init case right.
Second returning error doesnt help as you are calling this from remove and
return is not checked so redundant!

-- 
~Vinod

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ