[Armadeus-commitlog] armadeus branch, master, updated. latestrelease-156-gb1a0f55
Brought to you by:
sszy
|
From: Fabien M <fa...@us...> - 2009-11-20 15:14:02
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via b1a0f554e835b94428d8b7edf7ad71aab26ea1f2 (commit)
from a18d9bea9373c5a9d745a2fab38050b877f21513 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit b1a0f554e835b94428d8b7edf7ad71aab26ea1f2
Author: Fabien Marteau <fab...@ar...>
Date: Fri Nov 20 16:13:19 2009 +0100
[as_devices] segfault fix on as_93lcxx_close()
-----------------------------------------------------------------------
Summary of changes:
target/packages/as_devices/c/as_93lcxx.c | 10 +++++-----
target/packages/as_devices/c/as_spi.c | 6 ++++--
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/target/packages/as_devices/c/as_93lcxx.c b/target/packages/as_devices/c/as_93lcxx.c
index 5caf3de..d0d36c6 100644
--- a/target/packages/as_devices/c/as_93lcxx.c
+++ b/target/packages/as_devices/c/as_93lcxx.c
@@ -64,12 +64,12 @@ struct as_93lcxx_device * as_93lcxx_open(unsigned char *aSpidev_filename,
uint32_t aSpeed,
uint8_t aWord_size)
{
- int ret=0;
+ int fd=-1;
struct as_93lcxx_device *dev;
/* open spidev bus */
- ret = as_spi_open(aSpidev_filename);
- if(ret < 0)
+ fd = as_spi_open(aSpidev_filename);
+ if(fd < 0)
return NULL;
/* verify datas */
@@ -87,6 +87,7 @@ struct as_93lcxx_device * as_93lcxx_open(unsigned char *aSpidev_filename,
dev->type = aType;
dev->speed = aSpeed;
dev->word_size = aWord_size;
+ dev->fd = fd;
return dev;
}
@@ -94,7 +95,6 @@ struct as_93lcxx_device * as_93lcxx_open(unsigned char *aSpidev_filename,
void as_93lcxx_close(struct as_93lcxx_device *aDev)
{
as_spi_close(aDev->fd);
- free(aDev->spidev_filename);
free(aDev);
}
@@ -220,7 +220,7 @@ int32_t as_93lcxx_write_all(struct as_93lcxx_device *aDev,
3 + add_length + aDev->word_size,
aDev->speed);
- /* TODO: mait for RDY/BSY_n */
+ /* TODO: wait for RDY/BSY_n */
return 0;
}
diff --git a/target/packages/as_devices/c/as_spi.c b/target/packages/as_devices/c/as_spi.c
index 5d82054..bc70b8c 100644
--- a/target/packages/as_devices/c/as_spi.c
+++ b/target/packages/as_devices/c/as_spi.c
@@ -117,13 +117,15 @@ uint32_t as_spi_msg(int aFd,
uint32_t aSpeed)
{
uint32_t msg;
- size_t len;
+ int len;
+
struct spi_ioc_transfer xfer[1];
unsigned char buf[32];
unsigned char buf_read[32];
int status;
int i;
+
msg = aMsg;
len = aLen;
@@ -131,7 +133,7 @@ uint32_t as_spi_msg(int aFd,
memset(buf, 0, sizeof buf);
memset(buf_read, 0, sizeof buf_read);
- if (aLen > sizeof buf)
+ if (len > sizeof buf)
len = sizeof buf;
for (i = len;i > 0;i--)
{
hooks/post-receive
--
armadeus
|