public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH v5 00/15] staging: gpib: Handle gpib_register_driver() errors
@ 2024-12-28  6:07 Nihar Chaithanya
  2024-12-28  6:07 ` [PATCH v5 01/15] staging: gpib: Modify gpib_register_driver() to return error if it fails Nihar Chaithanya
                   ` (14 more replies)
  0 siblings, 15 replies; 21+ messages in thread
From: Nihar Chaithanya @ 2024-12-28  6:07 UTC (permalink / raw)
  To: dpenkler, gregkh
  Cc: dan.carpenter, skhan, linux-staging, linux-kernel,
	Nihar Chaithanya

While reviewing the patch for fixing Coverity scan issue from
gpib: cb7210 [1], Greg pointed out that the gpib_register_driver()
function can fail and must return an error value if it fails.

This patch series fixes the above issue by changing the return type
of gpib_register_driver() function and returning the error value if
it fails.

This fix also makes sure that wherever the gpib_register_driver()
is called and if it fails - the previous driver register functions
are unregistered(if they exist) and the error value is returned.

Thanks,
Nihar

v4 --> v5 : Added pr_* statements indicating when the driver register
            functions fail or if the module is initialized without errors.

v3 --> v4 : Made the v3 patch into series and also fixed an error in
            v3 [2]. Each patch in this series is a fix for particular
            driver handling the gpib_register_driver() error.

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.

v1 --> v2 : Replaced the redundant cb_pcmcia_init_module() with
            pcmcia_register_driver().

Link to v4 : https://lore.kernel.org/all/20241226193637.241049-16-niharchaithanya@gmail.com/
Link to v3 : https://lore.kernel.org/all/20241221214822.163667-1-niharchaithanya@gmail.com/
Link to v2 : https://lore.kernel.org/all/20241221091121.35476-1-niharchaithanya@gmail.com/
Link to v1 : https://lore.kernel.org/all/20241221022632.20931-1-niharchaithanya@gmail.com/

[1] https://lore.kernel.org/all/2024122133-outskirts-causing-099a@gregkh/
[2] https://lore.kernel.org/all/202412221424.WIjKFIPf-lkp@intel.com/

Nihar Chaithanya (15):
  staging: gpib: Modify gpib_register_driver() to return error if it
    fails
  staging: gpib: agilent_82350b: Handle gpib_register_driver() errors
  staging: gpib: agilent_82357a: Handle gpib_register_driver() errors
  staging: gpib: cb7210: Handle gpib_register_driver() errors
  staging: gpib: cec: Handle gpib_register_driver() errors
  staging: gpib: fluke: Handle gpib_register_driver() errors
  staging: gpib: fmh: Handle gpib_register_driver() errors
  staging: gpib: gpio: Return error value from gpib_register_driver()
  staging: gpib: hp_82335: Return error value from
    gpib_register_driver()
  staging: gpib: hp_82341: Handle gpib_register_driver() errors
  staging: gpib: ines: Handle gpib_register_driver() errors
  staging: gpib: lpvo_usb: Return error value from
    gpib_register_driver()
  staging: gpib: ni_usb: Handle gpib_register_driver() errors
  staging: gpib: pc2: Handle gpib_register_driver() errors
  staging: gpib: tnt4882: Handle gpib_register_driver() errors

 .../gpib/agilent_82350b/agilent_82350b.c      | 21 +++-
 .../gpib/agilent_82357a/agilent_82357a.c      | 18 +++-
 drivers/staging/gpib/cb7210/cb7210.c          | 99 ++++++++++++++-----
 drivers/staging/gpib/cec/cec_gpib.c           |  9 +-
 drivers/staging/gpib/common/gpib_os.c         |  7 +-
 drivers/staging/gpib/eastwood/fluke_gpib.c    | 28 +++++-
 drivers/staging/gpib/fmh_gpib/fmh_gpib.c      | 41 ++++++--
 drivers/staging/gpib/gpio/gpib_bitbang.c      |  7 +-
 drivers/staging/gpib/hp_82335/hp82335.c       |  9 +-
 drivers/staging/gpib/hp_82341/hp_82341.c      | 18 +++-
 drivers/staging/gpib/include/gpibP.h          |  2 +-
 drivers/staging/gpib/ines/ines_gpib.c         | 81 +++++++++++----
 .../gpib/lpvo_usb_gpib/lpvo_usb_gpib.c        |  6 +-
 drivers/staging/gpib/ni_usb/ni_usb_gpib.c     | 17 +++-
 drivers/staging/gpib/pc2/pc2_gpib.c           | 34 ++++++-
 drivers/staging/gpib/tnt4882/tnt4882_gpib.c   | 87 +++++++++++++---
 16 files changed, 387 insertions(+), 97 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2024-12-29 10:46 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-28  6:07 [PATCH v5 00/15] staging: gpib: Handle gpib_register_driver() errors Nihar Chaithanya
2024-12-28  6:07 ` [PATCH v5 01/15] staging: gpib: Modify gpib_register_driver() to return error if it fails Nihar Chaithanya
2024-12-29 10:30   ` Greg KH
2024-12-28  6:07 ` [PATCH v5 02/15] staging: gpib: agilent_82350b: Handle gpib_register_driver() errors Nihar Chaithanya
2024-12-29 10:29   ` Greg KH
2024-12-28  6:07 ` [PATCH v5 03/15] staging: gpib: agilent_82357a: " Nihar Chaithanya
2024-12-28  6:07 ` [PATCH v5 04/15] staging: gpib: cb7210: " Nihar Chaithanya
2024-12-28  6:07 ` [PATCH v5 05/15] staging: gpib: cec: " Nihar Chaithanya
2024-12-28  6:07 ` [PATCH v5 06/15] staging: gpib: fluke: " Nihar Chaithanya
2024-12-28  6:07 ` [PATCH v5 07/15] staging: gpib: fmh: " Nihar Chaithanya
2024-12-28  9:24   ` kernel test robot
2024-12-28  6:07 ` [PATCH v5 08/15] staging: gpib: gpio: Return error value from gpib_register_driver() Nihar Chaithanya
2024-12-28  6:07 ` [PATCH v5 09/15] staging: gpib: hp_82335: " Nihar Chaithanya
2024-12-28  6:07 ` [PATCH v5 10/15] staging: gpib: hp_82341: Handle gpib_register_driver() errors Nihar Chaithanya
2024-12-28  6:07 ` [PATCH v5 11/15] staging: gpib: ines: " Nihar Chaithanya
2024-12-29 10:28   ` Greg KH
2024-12-29 10:46     ` Nihar Chaithanya
2024-12-28  6:08 ` [PATCH v5 12/15] staging: gpib: lpvo_usb: Return error value from gpib_register_driver() Nihar Chaithanya
2024-12-28  6:08 ` [PATCH v5 13/15] staging: gpib: ni_usb: Handle gpib_register_driver() errors Nihar Chaithanya
2024-12-28  6:08 ` [PATCH v5 14/15] staging: gpib: pc2: " Nihar Chaithanya
2024-12-28  6:08 ` [PATCH v5 15/15] staging: gpib: tnt4882: " Nihar Chaithanya

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox