bugfix: bad vme_addr validation

The new vme_addr sysfs attribute had incorrect validation:
it was the old value stored in the card structure who was
validated by mistake. Moreover, the vme_addr is an offset,
so it has to be compared with the configured size, not
the end of the (absolute) vme address range of the board.
parent 51351e3d
......@@ -205,11 +205,10 @@ ATTR_STORE_CALLBACK(vme_addr)
if (sscanf(buf, "%i", &addr) != 1)
return -EINVAL;
if (card->vme_raw_addr >=
card->cfg_cur.vme_base + card->cfg_cur.vme_size)
if (addr >= card->cfg_cur.vme_size)
return -EINVAL;
if (card->vme_raw_addr & 3)
if (addr & 3)
return -EINVAL;
card->vme_raw_addr = addr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment