summaryrefslogtreecommitdiff
path: root/net/aoe/files/patch-aoeblk.c
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2024-01-02 13:10:47 -0500
committerMark Johnston <markj@FreeBSD.org>2024-01-02 20:00:26 -0500
commit823c8faa750685c75c8a9a701f0e36808dd7bd48 (patch)
tree6ad20a6a15277f4c2a44a18cd0247df454436cac /net/aoe/files/patch-aoeblk.c
parentsysutils/mbgtools: Add error checking for copyin() and copyout() calls (diff)
net/aoe: Fix error handling for a copyout() call
This will soon be required by the base system. PR: 275986 Approved by: antoine
Diffstat (limited to 'net/aoe/files/patch-aoeblk.c')
-rw-r--r--net/aoe/files/patch-aoeblk.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/net/aoe/files/patch-aoeblk.c b/net/aoe/files/patch-aoeblk.c
new file mode 100644
index 000000000000..7c096292da89
--- /dev/null
+++ b/net/aoe/files/patch-aoeblk.c
@@ -0,0 +1,23 @@
+--- aoeblk.c.orig 2024-01-03 00:56:10 UTC
++++ aoeblk.c
+@@ -114,7 +114,7 @@ aoeblk_ioctl(struct disk *disk, u_long cmd, void *vp,
+ {
+ struct ata_ioc_request *iocmd;
+ struct aoedev *d;
+- int n;
++ int error, n;
+
+ if (cmd != IOCATAREQUEST) {
+ IPRINTK("cmd %ld not IOCATA.\n", cmd);
+@@ -153,9 +153,9 @@ aoeblk_ioctl(struct disk *disk, u_long cmd, void *vp,
+
+ switch (iocmd->ata_ioc_request_ata.command) {
+ case ATA_ATA_IDENTIFY:
+- copyout(d->ad_ident, iocmd->ata_ioc_request_data, sizeof d->ad_ident);
++ error = copyout(d->ad_ident, iocmd->ata_ioc_request_data, sizeof d->ad_ident);
+ mtx_unlock(&d->ad_mtx);
+- return (0);
++ return (error);
+ case ATA_SMART:
+ if (iocmd->ata_ioc_request_ata.feature != ATA_SMART_ATTR_AUTOSAVE) {
+ n = aoecmd_ata_smart(d, iocmd);