On Sun, Dec 22, 2024 at 03:18:24AM +0530, Nihar Chaithanya wrote: > The function gpib_register_driver() can fail when kmalloc() > fails but it does not return an error code. > The function pcmcia_register_driver() returns an error code but > most of the times is not handled in gpib. > > Modify gpid_register_driver() to return appropriate error code > and also handle the error code returned by pcmcia_register_driver() > incase it fails. When any of these functions fail unwind and > unregister the driver to avoid semi-registered system. > > This issue was reported by Coverity Scan. > Report: > CID 1635894: (#1 of 1): 'Constant' variable guards dead code (DEADCODE) > dead_error_line: Execution cannot reach this statement: return -1;. > > Signed-off-by: Nihar Chaithanya <niharchaithanya@xxxxxxxxx> > --- > v2 --> v3 : Modified the gpib_register_driver() to return error code, > added error handling to all the places that the > gpib_register_driver() is called. You are doing a lot of different things all at once here. Please break this up into a patch series, only doing one "logical" thing per change please. thanks, greg k-h