Re: [PATCH] target: Fix transport_lookup_tmr_lun failure cases

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

 



Thanks Nick, we'll test this out here tomorrow morning.

> @@ -75,10 +75,15 @@ void core_tmr_release_req(
>  {
>        struct se_device *dev = tmr->tmr_dev;
>
> +       if (!dev) {
> +               kmem_cache_free(se_tmr_req_cache, tmr);
> +               return;
> +       }
> +
>        spin_lock(&dev->se_tmr_lock);
>        list_del(&tmr->tmr_list);
> -       kmem_cache_free(se_tmr_req_cache, tmr);
>        spin_unlock(&dev->se_tmr_lock);
> +       kmem_cache_free(se_tmr_req_cache, tmr);
>  }
>

I would have written this as:

        if (dev) {
               spin_lock(&dev->se_tmr_lock);
               list_del(&tmr->tmr_list);
               spin_unlock(&dev->se_tmr_lock);
        }

        kmem_cache_free(se_tmr_req_cache, tmr);

Not that it matters much either way.

 - R.
--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux