diff --git a/sbin/camcontrol/camcontrol.c b/sbin/camcontrol/camcontrol.c index 0ffd10e7e23c..362bedd3ba7a 100644 --- a/sbin/camcontrol/camcontrol.c +++ b/sbin/camcontrol/camcontrol.c @@ -4758,7 +4758,10 @@ smpreportgeneral(struct cam_device *device, int argc, char **argv, 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));