Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6:
ieee1394: sbp2: remove a workaround for Momobay FX-3A
firewire: sbp2: remove a workaround for Momobay FX-3A
firewire: sbp2: fix status reception
firewire: core: fix topology map response handler
firewire: core: fix race with parallel PCI device probe
firewire: core: header file cleanup
firewire: ohci: fix Self ID Count register mask (safeguard against buffer overflow)
ieee1394: raw1394: Do not leak memory on failed trylock.

+34 -36
+5 -8
drivers/firewire/core-card.c
··· 444 444 card->guid = guid; 445 445 446 446 mutex_lock(&card_mutex); 447 - config_rom = generate_config_rom(card, &length); 448 - list_add_tail(&card->link, &card_list); 449 - mutex_unlock(&card_mutex); 450 447 448 + config_rom = generate_config_rom(card, &length); 451 449 ret = card->driver->enable(card, config_rom, length); 452 - if (ret < 0) { 453 - mutex_lock(&card_mutex); 454 - list_del(&card->link); 455 - mutex_unlock(&card_mutex); 456 - } 450 + if (ret == 0) 451 + list_add_tail(&card->link, &card_list); 452 + 453 + mutex_unlock(&card_mutex); 457 454 458 455 return ret; 459 456 }
+1 -1
drivers/firewire/core-transaction.c
··· 834 834 } 835 835 836 836 static struct fw_address_handler topology_map = { 837 - .length = 0x200, 837 + .length = 0x400, 838 838 .address_callback = handle_topology_map, 839 839 }; 840 840
+14
drivers/firewire/core.h
··· 96 96 int fw_compute_block_crc(u32 *block); 97 97 void fw_schedule_bm_work(struct fw_card *card, unsigned long delay); 98 98 99 + static inline struct fw_card *fw_card_get(struct fw_card *card) 100 + { 101 + kref_get(&card->kref); 102 + 103 + return card; 104 + } 105 + 106 + void fw_card_release(struct kref *kref); 107 + 108 + static inline void fw_card_put(struct fw_card *card) 109 + { 110 + kref_put(&card->kref, fw_card_release); 111 + } 112 + 99 113 100 114 /* -cdev */ 101 115
+2 -2
drivers/firewire/ohci.c
··· 1279 1279 * the inverted quadlets and a header quadlet, we shift one 1280 1280 * bit extra to get the actual number of self IDs. 1281 1281 */ 1282 - self_id_count = (reg >> 3) & 0x3ff; 1283 - if (self_id_count == 0) { 1282 + self_id_count = (reg >> 3) & 0xff; 1283 + if (self_id_count == 0 || self_id_count > 252) { 1284 1284 fw_notify("inconsistent self IDs\n"); 1285 1285 return; 1286 1286 }
+8 -8
drivers/firewire/sbp2.c
··· 354 354 /* DViCO Momobay FX-3A with TSB42AA9A bridge */ { 355 355 .firmware_revision = 0x002800, 356 356 .model = 0x000000, 357 - .workarounds = SBP2_WORKAROUND_DELAY_INQUIRY | 358 - SBP2_WORKAROUND_POWER_CONDITION, 357 + .workarounds = SBP2_WORKAROUND_POWER_CONDITION, 359 358 }, 360 359 /* Initio bridges, actually only needed for some older ones */ { 361 360 .firmware_revision = 0x000200, ··· 424 425 struct sbp2_logical_unit *lu = callback_data; 425 426 struct sbp2_orb *orb; 426 427 struct sbp2_status status; 427 - size_t header_size; 428 428 unsigned long flags; 429 429 430 430 if (tcode != TCODE_WRITE_BLOCK_REQUEST || 431 - length == 0 || length > sizeof(status)) { 431 + length < 8 || length > sizeof(status)) { 432 432 fw_send_response(card, request, RCODE_TYPE_ERROR); 433 433 return; 434 434 } 435 435 436 - header_size = min(length, 2 * sizeof(u32)); 437 - fw_memcpy_from_be32(&status, payload, header_size); 438 - if (length > header_size) 439 - memcpy(status.data, payload + 8, length - header_size); 436 + status.status = be32_to_cpup(payload); 437 + status.orb_low = be32_to_cpup(payload + 4); 438 + memset(status.data, 0, sizeof(status.data)); 439 + if (length > 8) 440 + memcpy(status.data, payload + 8, length - 8); 441 + 440 442 if (STATUS_GET_SOURCE(status) == 2 || STATUS_GET_SOURCE(status) == 3) { 441 443 fw_notify("non-orb related status write, not handled\n"); 442 444 fw_send_response(card, request, RCODE_COMPLETE);
+3 -1
drivers/ieee1394/raw1394.c
··· 2272 2272 return -EFAULT; 2273 2273 } 2274 2274 2275 - if (!mutex_trylock(&fi->state_mutex)) 2275 + if (!mutex_trylock(&fi->state_mutex)) { 2276 + free_pending_request(req); 2276 2277 return -EAGAIN; 2278 + } 2277 2279 2278 2280 switch (fi->state) { 2279 2281 case opened:
+1 -2
drivers/ieee1394/sbp2.c
··· 372 372 /* DViCO Momobay FX-3A with TSB42AA9A bridge */ { 373 373 .firmware_revision = 0x002800, 374 374 .model = 0x000000, 375 - .workarounds = SBP2_WORKAROUND_DELAY_INQUIRY | 376 - SBP2_WORKAROUND_POWER_CONDITION, 375 + .workarounds = SBP2_WORKAROUND_POWER_CONDITION, 377 376 }, 378 377 /* Initio bridges, actually only needed for some older ones */ { 379 378 .firmware_revision = 0x000200,
-14
include/linux/firewire.h
··· 134 134 u32 topology_map[(CSR_TOPOLOGY_MAP_END - CSR_TOPOLOGY_MAP) / 4]; 135 135 }; 136 136 137 - static inline struct fw_card *fw_card_get(struct fw_card *card) 138 - { 139 - kref_get(&card->kref); 140 - 141 - return card; 142 - } 143 - 144 - void fw_card_release(struct kref *kref); 145 - 146 - static inline void fw_card_put(struct fw_card *card) 147 - { 148 - kref_put(&card->kref, fw_card_release); 149 - } 150 - 151 137 struct fw_attribute_group { 152 138 struct attribute_group *groups[2]; 153 139 struct attribute_group group;