mptsas Coverity fixes
cover mptsas Coverity fixes
Adding 3000 lines of code and not having Coverity complain would be quite an achievement. Three one-line fixes suffice, though.
Paolo
Paolo Bonzini (3):
mptsas: add missing va_end
mptsas: fix memory leak
mptsas: fix wrong formula
hw/scsi/mptconfig.c | 1 + hw/scsi/mptsas.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-)
Signature · 1 line
2.5.0
PATCH 1/3 mptsas: add missing va_end
Reported by Coverity.
Signed-off-by Paolo Bonzini <[email protected]>
--- hw/scsi/mptconfig.c | 1 + 1 file changed, 1 insertion(+)
hw/scsi/mptconfig.c +1 -0
@@ -123,6 +123,7 @@ static size_t vpack(uint8_t **p_data, const char *fmt, va_list ap1)va_copy (ap2, ap1); size =vfill (NULL ,0 , fmt, ap2); *p_data = data =g_malloc (size); +va_end (ap2); }return vfill (data, size, fmt, ap1); }
Signature · 1 line
2.5.0
PATCH 2/3 mptsas: fix memory leak
In reply to Paolo BonziniReported by Coverity.
Signed-off-by Paolo Bonzini <[email protected]>
--- hw/scsi/mptsas.c | 1 + 1 file changed, 1 insertion(+)
hw/scsi/mptsas.c +1 -0
@@ -504,6 +504,7 @@ reply_maybe_async: reply_async->IOCLogInfo = count;return ; } +g_free (reply_async); reply.TerminationCount = count;break ;
Signature · 1 line
2.5.0
PATCH 3/3 mptsas: fix wrong formula
In reply to Paolo BonziniMPI_DOORBELL_WHO_INIT_SHIFT is being repeated twice. Reported by Coverity.
Signed-off-by Paolo Bonzini <[email protected]>
--- hw/scsi/mptsas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/scsi/mptsas.c +1 -1
@@ -824,7 +824,7 @@ static uint32_t mptsas_doorbell_read(MPTSASState *s) {uint32_t ret; - ret = (s->who_init <<MPI_DOORBELL_WHO_INIT_SHIFT ) &MPI_DOORBELL_WHO_INIT_SHIFT ; + ret = (s->who_init <<MPI_DOORBELL_WHO_INIT_SHIFT ) &MPI_DOORBELL_WHO_INIT_MASK ; ret |= s->state;switch (s->doorbell_state) {case DOORBELL_NONE :
Signature · 1 line
2.5.0
Quoted 2 lines · Paolo Bonzini
Adding 3000 lines of code and not having Coverity complain would be quite an achievement. Three one-line fixes suffice, though.
Series
Reviewed-by Markus Armbruster <[email protected]>