Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F133083003
D6072.id15525.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D6072.id15525.diff
View Options
Index: lib/libcam/scsi_cmdparse.c
===================================================================
--- lib/libcam/scsi_cmdparse.c
+++ lib/libcam/scsi_cmdparse.c
@@ -662,11 +662,16 @@
csio_decode(struct ccb_scsiio *csio, const char *fmt, ...)
{
va_list ap;
+ int retval;
va_start(ap, fmt);
- return(do_buff_decode(csio->data_ptr, (size_t)csio->dxfer_len,
- 0, 0, fmt, ap));
+ retval = do_buff_decode(csio->data_ptr, (size_t)csio->dxfer_len, 0, 0,
+ fmt, ap);
+
+ va_end(ap);
+
+ return (retval);
}
int
@@ -675,28 +680,38 @@
void *puthook)
{
va_list ap;
+ int retval;
/*
* We need some way to output things; we can't do it without
* the arg_put function.
*/
if (arg_put == NULL)
- return(-1);
+ return (-1);
bzero(&ap, sizeof(ap));
- return(do_buff_decode(csio->data_ptr, (size_t)csio->dxfer_len,
- arg_put, puthook, fmt, ap));
+ retval = do_buff_decode(csio->data_ptr, (size_t)csio->dxfer_len,
+ arg_put, puthook, fmt, ap);
+
+ va_end(ap);
+
+ return (retval);
}
int
buff_decode(u_int8_t *buff, size_t len, const char *fmt, ...)
{
va_list ap;
+ int retval;
va_start(ap, fmt);
- return(do_buff_decode(buff, len, 0, 0, fmt, ap));
+ retval = do_buff_decode(buff, len, 0, 0, fmt, ap);
+
+ va_end(ap);
+
+ return (retval);
}
int
@@ -732,7 +747,7 @@
va_list ap;
if (csio == NULL)
- return(0);
+ return (0);
bzero(csio, sizeof(struct ccb_scsiio));
@@ -740,7 +755,7 @@
if ((retval = do_encode(csio->cdb_io.cdb_bytes, SCSI_MAX_CDBLEN,
&cmdlen, NULL, NULL, cmd_spec, ap)) == -1)
- return(retval);
+ goto done;
cam_fill_csio(csio,
/* retries */ retry_count,
@@ -753,7 +768,10 @@
/* cdb_len */ cmdlen,
/* timeout */ timeout ? timeout : 5000);
- return(retval);
+done:
+ va_end(ap);
+
+ return (retval);
}
int
@@ -802,13 +820,18 @@
csio_encode(struct ccb_scsiio *csio, const char *fmt, ...)
{
va_list ap;
+ int retval;
if (csio == NULL)
- return(0);
+ return (0);
va_start(ap, fmt);
- return(do_encode(csio->data_ptr, csio->dxfer_len, 0, 0, 0, fmt, ap));
+ retval = do_encode(csio->data_ptr, csio->dxfer_len, 0, 0, 0, fmt, ap);
+
+ va_end(ap);
+
+ return (retval);
}
int
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Oct 23, 7:52 PM (16 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
24100972
Default Alt Text
D6072.id15525.diff (2 KB)
Attached To
Mode
D6072: Add missing va_end's after corresponding va_start's to cleanup state
Attached
Detach File
Event Timeline
Log In to Comment