Re: [PATCH] drivers: scsi: ufs: Fix possible null derefrence

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

 



> Check for null before being dereferenced to avoid a invalid null
> dereference.
>
> Found using Coccinelle.
>
> Signed-off-by: Tapasweni Pathak <tapaswenipathak@xxxxxxxxx>
> Acked-by: Julia Lawall <julia.lawall@xxxxxxx>
> ---
>  drivers/scsi/ufs/ufshcd.c |    7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index 5d60a86..c54e64f 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -4268,12 +4268,15 @@ static int ufshcd_config_vreg(struct device *dev,
>  		struct ufs_vreg *vreg, bool on)
>  {
>  	int ret = 0;
> -	struct regulator *reg = vreg->reg;
> -	const char *name = vreg->name;
> +	struct regulator *reg;
> +	const char *name;
>  	int min_uV, uA_load;
>
>  	BUG_ON(!vreg);


Please add to the patch fix for another instance of this  in
ufshcd_config_vreg_load():

static int ufshcd_config_vreg_load(struct device *dev,
    struct ufs_vreg *vreg, int ua)
{
	int ret = 0;
	struct regulator *reg = vreg->reg;
	const char *name = vreg->name;

	BUG_ON(!vreg);


Gilad.

-- 
Qualcomm Israel, on behalf of Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

--
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