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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'char-misc-3.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull char/misc driver fixes from Greg KH:
"Here are 3 fixes for the mei and thunderbolt drivers that resolve some
reported issues.

All have been in linux-next for a while"

* tag 'char-misc-3.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
thunderbolt: Clear hops before overwriting
mei: nfc: fix memory leak in error path
mei: reset client state on queued connect request

+26 -7
+1
drivers/misc/mei/client.c
··· 601 601 cl->timer_count = MEI_CONNECT_TIMEOUT; 602 602 list_add_tail(&cb->list, &dev->ctrl_rd_list.list); 603 603 } else { 604 + cl->state = MEI_FILE_INITIALIZING; 604 605 list_add_tail(&cb->list, &dev->ctrl_wr_list.list); 605 606 } 606 607
+5 -6
drivers/misc/mei/nfc.c
··· 342 342 ndev = (struct mei_nfc_dev *) cldev->priv_data; 343 343 dev = ndev->cl->dev; 344 344 345 + err = -ENOMEM; 345 346 mei_buf = kzalloc(length + MEI_NFC_HEADER_SIZE, GFP_KERNEL); 346 347 if (!mei_buf) 347 - return -ENOMEM; 348 + goto out; 348 349 349 350 hdr = (struct mei_nfc_hci_hdr *) mei_buf; 350 351 hdr->cmd = MEI_NFC_CMD_HCI_SEND; ··· 355 354 hdr->data_size = length; 356 355 357 356 memcpy(mei_buf + MEI_NFC_HEADER_SIZE, buf, length); 358 - 359 357 err = __mei_cl_send(ndev->cl, mei_buf, length + MEI_NFC_HEADER_SIZE); 360 358 if (err < 0) 361 - return err; 362 - 363 - kfree(mei_buf); 359 + goto out; 364 360 365 361 if (!wait_event_interruptible_timeout(ndev->send_wq, 366 362 ndev->recv_req_id == ndev->req_id, HZ)) { ··· 366 368 } else { 367 369 ndev->req_id++; 368 370 } 369 - 371 + out: 372 + kfree(mei_buf); 370 373 return err; 371 374 } 372 375
+20 -1
drivers/thunderbolt/path.c
··· 150 150 151 151 /* Activate hops. */ 152 152 for (i = path->path_length - 1; i >= 0; i--) { 153 - struct tb_regs_hop hop; 153 + struct tb_regs_hop hop = { 0 }; 154 + 155 + /* 156 + * We do (currently) not tear down paths setup by the firmeware. 157 + * If a firmware device is unplugged and plugged in again then 158 + * it can happen that we reuse some of the hops from the (now 159 + * defunct) firmeware path. This causes the hotplug operation to 160 + * fail (the pci device does not show up). Clearing the hop 161 + * before overwriting it fixes the problem. 162 + * 163 + * Should be removed once we discover and tear down firmeware 164 + * paths. 165 + */ 166 + res = tb_port_write(path->hops[i].in_port, &hop, TB_CFG_HOPS, 167 + 2 * path->hops[i].in_hop_index, 2); 168 + if (res) { 169 + __tb_path_deactivate_hops(path, i); 170 + __tb_path_deallocate_nfc(path, 0); 171 + goto err; 172 + } 154 173 155 174 /* dword 0 */ 156 175 hop.next_hop = path->hops[i].next_hop_index;