RE: [smatch stuff] xshm: release misc device on error

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

 



Hi Dan,

>Smatch complains that we don't release the misc device on error.
>  1055          if (mutex_lock_interruptible(&dev->mutex)) {
>  1056                  xdev_dbg(dev, "mutex_lock_interruptible got signalled\n");
>
>-> if result is 0 here we should release it.  Should we call
>xshmchr_put() or misc_deregister()?
>
>  1057                  return -ERESTARTSYS;
>  1058          }

Thank you for spotting this!

If we take the mutex before registering the misc device it's
impossible for anyone else to take the mutex. 
So I think I will simply call mutex_lock() before misc_register().

I will fix this in my next patch-set,

Thanks,
Sjur

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


[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux