Re: [PATCH v2] s390/raw3270: Handle memory allocation failures in raw3270_setup_console()

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

 



On Tue, Jun 25, 2024 at 04:44:47PM +0900, Yunseong Kim wrote:
> Hi Heiko,
> >> -	set_bit(RAW3270_FLAGS_CONSOLE, &rp->flags);
> >> -
> >> +	}
> >>  	rc = ccw_device_enable_console(cdev);
> >>  	if (rc) {
> >>  		ccw_device_destroy_console(cdev);
> >> +		kfree(ascebc);
> >> +		kfree(rp);
> >>  		return ERR_PTR(rc);
> >>  	}
> >> +	set_bit(RAW3270_FLAGS_CONSOLE, &rp->flags);
> > 
> > Why did you move the set_bit() call?
> 
> Thank you for the code review Heiko.
> 
> While writing patch version 2, I spent a lot of time thinking about this
> part. Previously, even if function "ccw_device_enable_console" failed,
> the flag was set to RAW3270_FLAGS_CONSOLE and returned.
> 
> I think it would be more appropriate to set the bit after everything
> succeeded, so I included and submitted this code in v2 patch.
> 
> I’d appreciate hearing your thoughts on this!

"More appropriate" is not a technical reason. Please don't mix
different things into a single patch. If the set_bit() call needs to
be moved then you need to provide a technical reason for it.




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux