summaryrefslogtreecommitdiffstats
path: root/cli.c
diff options
context:
space:
mode:
Diffstat (limited to 'cli.c')
-rw-r--r--cli.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/cli.c b/cli.c
index 6eb9305..d323f3a 100644
--- a/cli.c
+++ b/cli.c
@@ -1013,7 +1013,11 @@ int main(int argc, char **argv) {
if (addr) {
if ((!strncmp(addr, "dma", 3))&&((addr[3]==0)||isnumber(addr+3))) {
if ((type)&&(amode != ACCESS_DMA)) Usage(argc, argv, "Conflicting access modes, the DMA read is requested, but access type is (%s)", type);
- if ((addr[3] != 0)&&(strcmp(addr + 3, bank))) Usage(argc, argv, "Conflicting DMA channels are specified in read parameter (%s) and bank parameter (%s)", addr + 3, bank);
+ if (bank) {
+ if ((addr[3] != 0)&&(strcmp(addr + 3, bank))) Usage(argc, argv, "Conflicting DMA channels are specified in read parameter (%s) and bank parameter (%s)", addr + 3, bank);
+ } else {
+ if (addr[3] == 0) Usage(argc, argv, "The DMA channel is not specified");
+ }
dma = atoi(addr + 3);
amode = ACCESS_DMA;
} else if ((!strncmp(addr, "bar", 3))&&((addr[3]==0)||isnumber(addr+3))) {