Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Jan 2003 16:46:15 -0800 (PST)
From:      Nate Lawson <nate@root.org>
To:        current@freebsd.org
Cc:        ryan beasley <ryanb@goddamnbastard.org>
Subject:   if_dc.c locking patch
Message-ID:  <Pine.BSF.4.21.0301061642240.12472-200000@root.org>
In-Reply-To: <20030104074914.GS311@goddamnbastard.org>

next in thread | previous in thread | raw e-mail | index | archive | help
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

--0-445848951-1041900375=:12472
Content-Type: TEXT/PLAIN; charset=US-ASCII

Attached is a diff that fixes a "could sleep" problem where
ether_ifattach() does a malloc and dc(4) is holding a lock in its softc.  
It uses a cleaner exit strategy with only one call to DC_UNLOCK and no
multiple return statements as well as fixing one place where "error"
wasn't set.  If people are ok with it, I'll sweep other drivers that have
a similar problem.

-Nate

--0-445848951-1041900375=:12472
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="if_dc.diff"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.BSF.4.21.0301061646150.12472@root.org>
Content-Description: 
Content-Disposition: attachment; filename="if_dc.diff"

SW5kZXg6IGlmX2RjLmMNCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0NClJDUyBm
aWxlOiAvaG9tZS9uY3ZzL3NyYy9zeXMvcGNpL2lmX2RjLmMsdg0KcmV0cmll
dmluZyByZXZpc2lvbiAxLjg1DQpkaWZmIC11IC1yMS44NSBpZl9kYy5jDQot
LS0gaWZfZGMuYwkyNyBOb3YgMjAwMiAwNzowNDoxMCAtMDAwMAkxLjg1DQor
KysgaWZfZGMuYwk3IEphbiAyMDAzIDAwOjM2OjMwIC0wMDAwDQpAQCAtMjE2
Miw2ICsyMTYyLDcgQEANCiAJCW1hYyA9IHBjaV9nZXRfZXRoZXIoZGV2KTsN
CiAJCWlmICghbWFjKSB7DQogCQkJZGV2aWNlX3ByaW50ZihkZXYsICJObyBz
dGF0aW9uIGFkZHJlc3MgaW4gQ0lTIVxuIik7DQorCQkJZXJyb3IgPSBFTlhJ
TzsNCiAJCQlnb3RvIGZhaWw7DQogCQl9DQogCQliY29weShtYWMsIGVhZGRy
LCBFVEhFUl9BRERSX0xFTik7DQpAQCAtMjI2NiwxMSArMjI2Nyw2IEBADQog
CX0NCiANCiAJLyoNCi0JICogQ2FsbCBNSSBhdHRhY2ggcm91dGluZS4NCi0J
ICovDQotCWV0aGVyX2lmYXR0YWNoKGlmcCwgZWFkZHIpOw0KLQ0KLQkvKg0K
IAkgKiBUZWxsIHRoZSB1cHBlciBsYXllcihzKSB3ZSBzdXBwb3J0IGxvbmcg
ZnJhbWVzLg0KIAkgKi8NCiAJaWZwLT5pZl9kYXRhLmlmaV9oZHJsZW4gPSBz
aXplb2Yoc3RydWN0IGV0aGVyX3ZsYW5faGVhZGVyKTsNCkBAIC0yMzA0LDE0
ICsyMzAwLDE2IEBADQogCX0NCiAjZW5kaWYNCiANCi0JRENfVU5MT0NLKHNj
KTsNCi0JcmV0dXJuKDApOw0KLQ0KIGZhaWw6DQogCURDX1VOTE9DSyhzYyk7
DQogZmFpbF9ub2xvY2s6DQotCW10eF9kZXN0cm95KCZzYy0+ZGNfbXR4KTsN
Ci0JcmV0dXJuKGVycm9yKTsNCisJLyogSWYgbm8gZXJyb3JzLCBjYWxsIHRo
ZSBNSSBhdHRhY2ggcm91dGluZS4gKi8NCisJaWYgKGVycm9yID09IDApDQor
CQlldGhlcl9pZmF0dGFjaChpZnAsIGVhZGRyKTsNCisJZWxzZQ0KKwkJbXR4
X2Rlc3Ryb3koJnNjLT5kY19tdHgpOw0KKw0KKwlyZXR1cm4gKGVycm9yKTsN
CiB9DQogDQogc3RhdGljIGludA0K
--0-445848951-1041900375=:12472--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0301061642240.12472-200000>