if (o == NULL) {
usb_mtp_queue_result(s, RES_INVALID_OBJECT_HANDLE, c->trans,
0, 0, 0, 0);
- }
- if (o->format != FMT_ASSOCIATION) {
+ } else if (o->format != FMT_ASSOCIATION) {
usb_mtp_queue_result(s, RES_INVALID_PARENT_OBJECT, c->trans,
0, 0, 0, 0);
}
uint32_t next_handle = s->next_handle;
assert(!s->write_pending);
+ assert(p != NULL);
utf16_to_str(dataset->length, dataset->filename, filename);
p->status = USB_RET_STALL;
return;
}
- if (s->data_out && !s->data_out->first) {
+ if ((s->data_out != NULL) && !s->data_out->first) {
container_type = TYPE_DATA;
} else {
usb_packet_copy(p, &container, sizeof(container));