[PATCH] DAC960_Release bug (2.4.x)

John v/d Kamp (john@connectux.com)
Wed, 16 Apr 2003 11:55:51 +0200 (CEST)


This is a MIME-formatted message. If you see this text it means that your
E-mail software does not support MIME-formatted messages.

--=_courier-29836-1050486981-0001-2
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi,

It seems the DAC960_Release function doesn't work correctly when
DAC960_Open is called with File->f_flags has O_NONBLOCK set. This causes
BLKRRPART to fail, as an unsigned int gets decreased below 0.
The File struct passed to DAC960_Release is NULL, so in Open the counters
aren't increased, but in Release they are decreased. I've added a simple
check that prevents the decrements if the counters are 0.

Allso, I've no idea why there are two counters. It seems that the
ControllerUsageCount is only used to increment and decrement.

--
John van der Kamp, ConnecTUX
--=_courier-29836-1050486981-0001-2
Content-Type: text/plain; charset=us-ascii; name="dac960.patch"
Content-Transfer-Encoding: base64
Content-ID: <Pine.LNX.4.53.0304161155510.18523@fratser>
Content-Description: 
Content-Disposition: attachment; filename="dac960.patch"

ZGlmZiAtdXIgbGludXgtMi40LjE5L2RyaXZlcnMvYmxvY2svREFDOTYwLmMg cGF0Y2hlZC0yLjQuMTkvZHJpdmVycy9ibG9jay9EQUM5NjAuYw0KLS0tIGxp bnV4LTIuNC4xOS9kcml2ZXJzL2Jsb2NrL0RBQzk2MC5jCTIwMDItMDktMTMg MTc6NDE6MzAuMDAwMDAwMDAwICswMjAwDQorKysgcGF0Y2hlZC0yLjQuMTkv ZHJpdmVycy9ibG9jay9EQUM5NjAuYwkyMDAzLTA0LTE2IDExOjA3OjE2LjAw MDAwMDAwMCArMDIwMA0KQEAgLTUzOTgsOCArNTM5OCwxMCBAQA0KICAgLyoN CiAgICAgRGVjcmVtZW50IHRoZSBMb2dpY2FsIERyaXZlIGFuZCBDb250cm9s bGVyIFVzYWdlIENvdW50cy4NCiAgICovDQotICBDb250cm9sbGVyLT5Mb2dp Y2FsRHJpdmVVc2FnZUNvdW50W0xvZ2ljYWxEcml2ZU51bWJlcl0tLTsNCi0g IENvbnRyb2xsZXItPkNvbnRyb2xsZXJVc2FnZUNvdW50LS07DQorICBpZiAo Q29udHJvbGxlci0+TG9naWNhbERyaXZlVXNhZ2VDb3VudFtMb2dpY2FsRHJp dmVOdW1iZXJdID4gMCkNCisgICAgQ29udHJvbGxlci0+TG9naWNhbERyaXZl VXNhZ2VDb3VudFtMb2dpY2FsRHJpdmVOdW1iZXJdLS07DQorICBpZiAoQ29u dHJvbGxlci0+Q29udHJvbGxlclVzYWdlQ291bnQgPiAwKQ0KKyAgICBDb250 cm9sbGVyLT5Db250cm9sbGVyVXNhZ2VDb3VudC0tOw0KICAgcmV0dXJuIDA7 DQogfQ0K

--=_courier-29836-1050486981-0001-2--