Re: [PATCH v3 4/4] scsi: ufs: probe and init of variant driver from the platform device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2015-06-08 1:27 GMT+09:00 Yaniv Gardi <ygardi@xxxxxxxxxxxxxx>:
>  static int ufshcd_pltfrm_remove(struct platform_device *pdev)
>  {
>         struct ufs_hba *hba =  platform_get_drvdata(pdev);
> +       struct device_node *node = pdev->dev.of_node;
> +       struct device_node *ufs_variant_node;
> +       struct platform_device *ufs_variant_pdev;
> +
> +       ufs_variant_node = of_get_next_available_child(node, NULL);
> +
> +       if (!ufs_variant_node)
> +               dev_dbg(&pdev->dev, "no ufs_variant_node found\n");
> +       else
> +               ufs_variant_pdev = of_find_device_by_node(ufs_variant_node);
>
>         pm_runtime_get_sync(&(pdev)->dev);
>         ufshcd_remove(hba);
> +       module_put(ufs_variant_pdev->dev.driver->owner);

module_put() should only be called when ufs_variant sub-node exists
and hba->vops was found.
If ufs->vops == NULL or no ufs_variant sub-node exists, this line
causes uninitialized pointer dereference.

>         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




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux