Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-6499

leaking a kernel device on error in init_obdclass

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.10.0
    • Lustre 2.8.0
    • 3
    • 9223372036854775807

    Description

      Highlighted by smatch:

      init_obdclass has this nice code:

              err = misc_register(&obd_psdev);
              if (err) {
                      CERROR("cannot register %d err %d\n", OBD_DEV_MINOR, err);
                      return err;
              }
      ...
              err = obd_init_caches();
              if (err)
                      return err;
              err = class_procfs_init();
              if (err)
                      return err;
      
              err = lu_global_init();
              if (err)
                      return err;
      
              err = lu_capainfo_init();
              if (err)
                      return err;
      ...
      

      leaking reference to the just registered device.
      We should really be freeing it on all subsequent errors.

      Attachments

        Activity

          People

            bfaccini Bruno Faccini (Inactive)
            green Oleg Drokin
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: