Re: [patch] ext4: potential NULL dereference on error

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

 



On Tue, May 15, 2012 at 12:25:35AM +0200, Jan Kara wrote:
> On Sun 13-05-12 17:41:04, Dan Carpenter wrote:
> > @@ -508,7 +509,8 @@ fallback_retry:
> >  	for (i = 0; i < ngroups; i++) {
> >  		grp = (parent_group + i) % ngroups;
> >  		desc = ext4_get_group_desc(sb, grp, NULL);
> > -		grp_free = ext4_free_inodes_count(sb, desc);
> > +		if (desc)
> > +			grp_free = ext4_free_inodes_count(sb, desc);
> >  		if (desc && grp_free && grp_free >= avefreei) {
>   So you it would be more logical to do:
> 		if (desc) {
> 			grp_free = ext4_free_inodes_count(sb, desc);
> 			if (grp_free && grpfree >= avefreei) {
> 	 			*group = grp;
> 	 			return 0;
> 			}
> 		}
> 
>   Wouldn't it?

Yeah.  You're obviously right.  I'll resend.

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux