From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941360AbcJSPyI (ORCPT ); Wed, 19 Oct 2016 11:54:08 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:32885 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S941043AbcJSPyF (ORCPT ); Wed, 19 Oct 2016 11:54:05 -0400 DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org 36CC16168E Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=pass smtp.mailfrom=okaya@codeaurora.org Subject: Re: [PATCH] dmaengine: qcom_hidma: cleanup sysfs entries during remove To: Vinod Koul References: <1475796189-26553-1-git-send-email-okaya@codeaurora.org> <20161019132622.GN2467@localhost> Cc: dmaengine@vger.kernel.org, timur@codeaurora.org, cov@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org From: Sinan Kaya Message-ID: Date: Wed, 19 Oct 2016 08:54:03 -0700 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20161019132622.GN2467@localhost> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/19/2016 6:26 AM, Vinod Koul wrote: >> -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! Agreed, I'll get rid of the attrs and also the return value. -- Sinan Kaya Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.