[PATCH] Bluetooth: fix oops in rfcomm tty code (v2)

From: Vegard Nossum
Date: Sat Jul 19 2008 - 17:13:12 EST


This is a resend of a patch I sent earlier. It fixes a reproducible
oops (see http://lkml.org/lkml/2008/7/13/89 for test case), and I'd
be very happy for some feedback from Bluetooth people. Can this be
included for testing somewhere? I don't have any bluetooth devices
myself, so all my testing is limited to creating/releasing devices
with ioctl (I'm not sure that's good enough).

Dave: I have extended the rfcomm_dev_lock to include all the setup and
teardown of a single device. On second thought, it doesn't really make
sense to use a separate lock for that. May I have your opinion on this
second version? (I've fixed the comments/BUG_ON that you pointed out.)