Skip to content

Commit

Permalink
dev_interface.cpp: Don't pass local buffer address to caller
Browse files Browse the repository at this point in the history
(cppcheck 2.11: autoVariables).

git-svn-id: https://svn.code.sf.net/p/smartmontools/code/trunk/smartmontools@5496 4ea69e1a-61f1-4043-bf83-b5c94c648137
  • Loading branch information
chrfranke committed Jul 10, 2023
1 parent 09dac5c commit 1b425c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ $Id$

2023-07-10 Christian Franke <[email protected]>

dev_interface.cpp: Don't pass local buffer address to caller
(cppcheck 2.11: autoVariables).

scsiprint.cpp: Remove unused code, remove unused variable
(cppcheck 2.11: knownConditionTrueFalse, unusedVariable).

Expand Down
2 changes: 2 additions & 0 deletions dev_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,15 @@ bool scsi_device::scsi_pass_through_and_check(scsi_cmnd_io * iop,
if (scsi_debugmode > 0)
pout("%sscsi_pass_through() failed, errno=%d [%s]\n",
msg, get_errno(), get_errmsg());
iop->sensep = nullptr;
return false;
}

// Check sense
scsi_sense_disect sinfo;
scsi_do_sense_disect(iop, &sinfo);
int err = scsiSimpleSenseFilter(&sinfo);
iop->sensep = nullptr;
if (err) {
if (scsi_debugmode > 0)
pout("%sscsi error: %s\n", msg, scsiErrString(err));
Expand Down

0 comments on commit 1b425c0

Please sign in to comment.