jtag: make caller always allocate buffer