Re: [PATCH V3 15/20] block: fail to show/store elevator sysfs attribute if elevator is dying

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

 



On Fri, Apr 25, 2025 at 08:36:14PM +0200, Christoph Hellwig wrote:
> On Thu, Apr 24, 2025 at 11:21:38PM +0800, Ming Lei wrote:
> > +	if (test_bit(ELEVATOR_FLAG_DYING, &e->flags))
> > +		error = -ENODEV;
> > +	else
> > +		error = e->type ? entry->show(e, page) : -ENOENT;
> 
> Weird style mix, I'd expand the check for ->type to a proper else
> if here as well.  But how can e->type actually be NULL here to start
> with?

You are right, e->type can't be NULL, which is assigned in its allocation,
never get cleared.


Thanks,
Ming





[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux