diff options
author | Matthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de> | 2011-03-01 16:14:36 +0100 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@ipe.fzk.de> | 2011-03-01 16:14:36 +0100 |
commit | 8a33c993a5771b041b67c365378ac40f76365da7 (patch) | |
tree | 77df88aae0638e453397f0809226b7737694817c /cli.c | |
parent | c428e3496a3c5f8046a7f1778b5bdcb551993e7b (diff) | |
download | pcitool-8a33c993a5771b041b67c365378ac40f76365da7.tar.gz pcitool-8a33c993a5771b041b67c365378ac40f76365da7.tar.bz2 pcitool-8a33c993a5771b041b67c365378ac40f76365da7.tar.xz pcitool-8a33c993a5771b041b67c365378ac40f76365da7.zip |
Write LSB first and fix memory allocation bug
Diffstat (limited to 'cli.c')
-rw-r--r-- | cli.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -376,8 +376,11 @@ int WriteData(int handle, int bar, unsigned long addr, int n, int access, char * int size = n * abs(access); err = posix_memalign( (void**)&buf, 256, size ); - if (!err) err = posix_memalign( (void**)&check, 256, size ); - if ((!err)||(!buf)||(!check)) Error("Allocation of %i bytes of memory have failed", size); + if (!err) { + err = posix_memalign( (void**)&check, 256, size ); + } + if ((err)||(!buf)||(!check)) + Error("Allocation of %i bytes of memory have failed", size); for (i = 0; i < n; i++) { switch (access) { |