- To: Namjae Jeon <linkinjeon@xxxxxxxxx>
- Subject: Re: [PATCH V2 3/4] [SCSI] ufs: Add Platform glue driver for ufshcd
- From: vinayak holikatti <vinholikatti@xxxxxxxxx>
- Date: Tue, 17 Jul 2012 11:39:49 +0530
- Cc: James.Bottomley@xxxxxxxxxxxxxxxxxxxxx, linux-scsi@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, patches@xxxxxxxxxx, linux-samsung-soc@xxxxxxxxxxxxxxx, santoshsy@xxxxxxxxx, arnd@xxxxxxxxxx, girish.shivananjappa@xxxxxxxxxx, saugata.das@xxxxxxxxxx, vishak.g@xxxxxxxxxxx, venkat@xxxxxxxxxx, k.rajesh@xxxxxxxxxxx, dsaxena@xxxxxxxxxx, ilho215.lee@xxxxxxxxxxx, nala.la@xxxxxxxxxxx, sreekumar.c@xxxxxxxxxxx
- In-reply-to: <CAKYAXd9cPuN-HfifDmz4M==QfjEW7CX6BF=rumSBSwRtO38_PQ@mail.gmail.com>
On Mon, Jul 16, 2012 at 7:19 PM, Namjae Jeon <linkinjeon@xxxxxxxxx> wrote:
> Hi Vinayak.
>> + * ufshcd_pltfrm_remove - remove platform driver routine
>> + * @pdev: pointer to platform device handle
>> + *
>> + * Returns 0 on success, non-zero value on failure
>> + */
>> +static int __devexit ufshcd_pltfrm_remove(struct platform_device *pdev)
>> +{
>> + struct resource *mem_res;
>> + struct resource *irq_res;
>> + resource_size_t mem_size;
>> + struct ufs_hba *hba = platform_get_drvdata(pdev);
>> +
>> + ufshcd_remove(hba);
>> + irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
>> + if (!irq_res)
>> + dev_err(&pdev->dev, "ufshcd: IRQ resource not available\n");
>> + free_irq(irq_res->start, hba);
> Is there no possibility of null pointer dereferencing error ?(irq_res->start)
> I think that free_irq should be not called if irq_res is NULL.
I agree, I have overlooked at this logic, the free_irq should have
been in the else
part of this section. I will make the modification in the next version
of patches.
>> + mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> Looks mem_res is also same with upper case.
> Thanks.
>> + mem_size = resource_size(mem_res);
>> + release_mem_region(mem_res->start, mem_size);
>> + platform_set_drvdata(pdev, NULL);
>> + return 0;
>> +}
>> +
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[SCSI Target Devel]
[Linux SCSI Target Infrastructure]
[Kernel Newbies]
[Share Photos]
[IDE]
[Security]
[Git]
[Netfilter]
[Bugtraq]
[Photos]
[Yosemite]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Linux ATA RAID]
[Linux IIO]
[Samba]
[Video 4 Linux]
[Device Mapper]
[Linux Resources]