.. | .. |
---|
1715 | 1715 | int bytes = 3 & less_cmd; |
---|
1716 | 1716 | int words = less_cmd >> 2; |
---|
1717 | 1717 | u8 *r = vub300->resp.response.command_response; |
---|
| 1718 | + |
---|
| 1719 | + if (!resp_len) |
---|
| 1720 | + return; |
---|
1718 | 1721 | if (bytes == 3) { |
---|
1719 | 1722 | cmd->resp[words] = (r[1 + (words << 2)] << 24) |
---|
1720 | 1723 | | (r[2 + (words << 2)] << 16) |
---|
.. | .. |
---|
2049 | 2052 | return; |
---|
2050 | 2053 | kref_get(&vub300->kref); |
---|
2051 | 2054 | if (enable) { |
---|
| 2055 | + set_current_state(TASK_RUNNING); |
---|
2052 | 2056 | mutex_lock(&vub300->irq_mutex); |
---|
2053 | 2057 | if (vub300->irqs_queued) { |
---|
2054 | 2058 | vub300->irqs_queued -= 1; |
---|
.. | .. |
---|
2064 | 2068 | vub300_queue_poll_work(vub300, 0); |
---|
2065 | 2069 | } |
---|
2066 | 2070 | mutex_unlock(&vub300->irq_mutex); |
---|
| 2071 | + set_current_state(TASK_INTERRUPTIBLE); |
---|
2067 | 2072 | } else { |
---|
2068 | 2073 | vub300->irq_enabled = 0; |
---|
2069 | 2074 | } |
---|
.. | .. |
---|
2299 | 2304 | 0x0000, 0x0000, &vub300->system_port_status, |
---|
2300 | 2305 | sizeof(vub300->system_port_status), 1000); |
---|
2301 | 2306 | if (retval < 0) { |
---|
2302 | | - goto error4; |
---|
| 2307 | + goto error5; |
---|
2303 | 2308 | } else if (sizeof(vub300->system_port_status) == retval) { |
---|
2304 | 2309 | vub300->card_present = |
---|
2305 | 2310 | (0x0001 & vub300->system_port_status.port_flags) ? 1 : 0; |
---|
2306 | 2311 | vub300->read_only = |
---|
2307 | 2312 | (0x0010 & vub300->system_port_status.port_flags) ? 1 : 0; |
---|
2308 | 2313 | } else { |
---|
2309 | | - goto error4; |
---|
| 2314 | + goto error5; |
---|
2310 | 2315 | } |
---|
2311 | 2316 | usb_set_intfdata(interface, vub300); |
---|
2312 | 2317 | INIT_DELAYED_WORK(&vub300->pollwork, vub300_pollwork_thread); |
---|
.. | .. |
---|
2329 | 2334 | "USB vub300 remote SDIO host controller[%d]" |
---|
2330 | 2335 | "connected with no SD/SDIO card inserted\n", |
---|
2331 | 2336 | interface_to_InterfaceNumber(interface)); |
---|
2332 | | - mmc_add_host(mmc); |
---|
| 2337 | + retval = mmc_add_host(mmc); |
---|
| 2338 | + if (retval) |
---|
| 2339 | + goto error6; |
---|
| 2340 | + |
---|
2333 | 2341 | return 0; |
---|
| 2342 | +error6: |
---|
| 2343 | + del_timer_sync(&vub300->inactivity_timer); |
---|
2334 | 2344 | error5: |
---|
2335 | 2345 | mmc_free_host(mmc); |
---|
2336 | 2346 | /* |
---|