Displaying 2 results from an estimated 2 matches for "d183ade".
2015 Aug 07
1
[PATCH] com32: write_sectors fixes
Based on syslinux 6.03
Memory allocation and copy length should be SECTOR * size for sectors operation.
Signed-off-by: Robert <luyao-c at 360.cn>
diff --git a/com32/gpllib/disk/write.c b/com32/gpllib/disk/write.c
index d183ade..3c9edff 100644
--- a/com32/gpllib/disk/write.c
+++ b/com32/gpllib/disk/write.c
@@ -40,7 +40,7 @@ int write_sectors(const struct driveinfo *drive_info, const unsigned int lba,
void *buf;
int rv = -1;
- buf = lmalloc(size);
+ buf = lmalloc(SECTOR * size);
if (!buf)
return -1...
2012 Jun 26
2
[GIT PULL] elflink bug fixes
...x.b[1];
- return -1; /* Give up */
+ goto fail; /* Give up */
}
memcpy(bufp, buf, sectors * SECTOR);
+ rv = sectors;
- return sectors;
+fail:
+ lfree(dapa);
+ lfree(buf);
+ return rv;
}
diff --git a/com32/gpllib/disk/write.c b/com32/gpllib/disk/write.c
index 89e530d..d183ade 100644
--- a/com32/gpllib/disk/write.c
+++ b/com32/gpllib/disk/write.c
@@ -36,8 +36,17 @@ int write_sectors(const struct driveinfo *drive_info, const unsigned int lba,
const void *data, const int size)
{
com32sys_t inreg, outreg;
- struct ebios_dapa *dapa = __com32.cs_bounce;
- voi...