diff options
author | jh <jh@FreeBSD.org> | 2012-08-23 16:25:36 +0000 |
---|---|---|
committer | jh <jh@FreeBSD.org> | 2012-08-23 16:25:36 +0000 |
commit | 6329a0ea94f171552c8f2ce006a60ea4d40bf5ad (patch) | |
tree | 4f278427c495a449986795c91f6582f23506e06c /sbin/camcontrol/camcontrol.c | |
parent | c4772b136178e590bd31be24114777fb70f2b78d (diff) | |
download | FreeBSD-src-6329a0ea94f171552c8f2ce006a60ea4d40bf5ad.zip FreeBSD-src-6329a0ea94f171552c8f2ce006a60ea4d40bf5ad.tar.gz |
Check the return value of sbuf_finish().
Diffstat (limited to 'sbin/camcontrol/camcontrol.c')
-rw-r--r-- | sbin/camcontrol/camcontrol.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sbin/camcontrol/camcontrol.c b/sbin/camcontrol/camcontrol.c index 0ffd10e..362bedd 100644 --- a/sbin/camcontrol/camcontrol.c +++ b/sbin/camcontrol/camcontrol.c @@ -4758,7 +4758,10 @@ try_long: smp_report_general_sbuf(response, sizeof(*response), sb); - sbuf_finish(sb); + if (sbuf_finish(sb) != 0) { + warnx("%s: sbuf_finish", __func__); + goto bailout; + } printf("%s", sbuf_data(sb)); @@ -5129,7 +5132,10 @@ smpmaninfo(struct cam_device *device, int argc, char **argv, smp_report_manuf_info_sbuf(&response, sizeof(response), sb); - sbuf_finish(sb); + if (sbuf_finish(sb) != 0) { + warnx("%s: sbuf_finish", __func__); + goto bailout; + } printf("%s", sbuf_data(sb)); |