summaryrefslogtreecommitdiffstats
path: root/sbin/camcontrol
diff options
context:
space:
mode:
authorsjg <sjg@FreeBSD.org>2013-10-13 02:35:19 +0000
committersjg <sjg@FreeBSD.org>2013-10-13 02:35:19 +0000
commit7fcd33c1faf567506b5c0b4148c7a15a10788a5d (patch)
tree2c6f4d1ca5d1c643faea64e1f4c90105a1ab406a /sbin/camcontrol
parent2a59274eda20cc626e28052fff7aa8b7bf6a3683 (diff)
parent5cca672bb0892f1c5da630c34a1f98e2de4d7064 (diff)
downloadFreeBSD-src-7fcd33c1faf567506b5c0b4148c7a15a10788a5d.zip
FreeBSD-src-7fcd33c1faf567506b5c0b4148c7a15a10788a5d.tar.gz
Merge head@256284
Diffstat (limited to 'sbin/camcontrol')
-rw-r--r--sbin/camcontrol/camcontrol.c2
-rw-r--r--sbin/camcontrol/fwdownload.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/sbin/camcontrol/camcontrol.c b/sbin/camcontrol/camcontrol.c
index e80c549..68c6d79 100644
--- a/sbin/camcontrol/camcontrol.c
+++ b/sbin/camcontrol/camcontrol.c
@@ -2748,7 +2748,7 @@ atasecurity(struct cam_device *device, int retry_count, int timeout,
if (strcasecmp(optarg, "user") == 0) {
pwd.ctrl |= ATA_SECURITY_PASSWORD_USER;
pwd.ctrl &= ~ATA_SECURITY_PASSWORD_MASTER;
- } else if (strcasecmp(optarg, "master") != 0) {
+ } else if (strcasecmp(optarg, "master") == 0) {
pwd.ctrl |= ATA_SECURITY_PASSWORD_MASTER;
pwd.ctrl &= ~ATA_SECURITY_PASSWORD_USER;
} else {
diff --git a/sbin/camcontrol/fwdownload.c b/sbin/camcontrol/fwdownload.c
index 7e57d32..181c234 100644
--- a/sbin/camcontrol/fwdownload.c
+++ b/sbin/camcontrol/fwdownload.c
@@ -224,6 +224,7 @@ fw_read_img(const char *fw_img_path, const struct fw_vendor *vp, int *num_bytes)
goto bailout;
}
*num_bytes = img_size;
+ close(fd);
return (buf);
bailout:
free(buf);
@@ -286,6 +287,7 @@ fw_download_img(struct cam_device *cam_dev, const struct fw_vendor *vp,
ata_28bit_cmd(&ccb->ataio, ATA_ATA_IDENTIFY, 0, 0, 0);
} else {
warnx("weird disk type '%s'", type);
+ cam_freeccb(ccb);
return 1;
}
/* Disable freezing the device queue. */
OpenPOWER on IntegriCloud