summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* [malloc] Track maximum heap usageMichael Brown2017-03-222-3/+23
| | | | | | | Track the current and maximum heap usage, and display the maximum during shutdown when DEBUG=malloc is enabled. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [mucurses] Ensure SLK labels are always terminatedMichael Brown2017-03-221-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [sis190] Avoid NULL pointer dereferenceMichael Brown2017-03-221-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [w89c840] Avoid potential array overrunMichael Brown2017-03-221-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tlan] Guard against failure to identify chipMichael Brown2017-03-221-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [hermon] Assert that mapping length is non-zeroMichael Brown2017-03-221-0/+1
| | | | | | | An (impossible) mapping length of zero produces a negative bit shift, which is technically undefined. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [arbel] Assert that mapping length is non-zeroMichael Brown2017-03-221-0/+1
| | | | | | | An (impossible) mapping length of zero produces a negative bit shift, which is technically undefined. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [video_subr] Use memmove() for overlapping memory copyMichael Brown2017-03-221-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcp] Use correct length for memset()Michael Brown2017-03-221-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [xen] Use standard calling pattern for asprintf()Michael Brown2017-03-221-2/+1Star
| | | | | | | | Our asprintf() implementation guarantees that strp will be NULL on allocation failure, but this is not standard behaviour. Detect errors by checking for a negative return value instead of a NULL pointer. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [usb] Use correct length for memcpy()Michael Brown2017-03-221-2/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pixbuf] Avoid potential division by zeroMichael Brown2017-03-221-1/+3
| | | | | | | | Avoid potential division by zero when performing the check against multiplication overflow. (Note that if the width is zero then there can be no overflow anyway, so it is then safe to bypass the check.) Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ath] Add missing break statementsMichael Brown2017-03-221-0/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [block] Quell spurious Coverity size mismatch warningMichael Brown2017-03-221-6/+10
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Return status code from ib_create_mi()Michael Brown2017-03-223-16/+19
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Return status code from ib_create_cq() and ib_create_qp()Michael Brown2017-03-228-90/+88Star
| | | | | | | | | | | | Any underlying errors arising during ib_create_cq() or ib_create_qp() are lost since the functions simply return NULL on error. This makes debugging harder, since a debug-enabled build is required to discover the root cause of the error. Fix by returning a status code from these functions, thereby allowing any underlying errors to be propagated. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Avoid confusing sparse in single-argument DBG() macrosMichael Brown2017-03-221-2/+2
| | | | | | | | | | | | | For visual consistency with surrounding lines, the definitions of DBG_MORE(), DBG_PAUSE(), etc include an unnecessary ##__VA_ARGS__ argument which is always elided. This confuses sparse, which complains about DBG_MORE_IF() being called with more than one argument. Work around this problem by adding an unused variable argument list to the single-argument macros DBG_MORE_IF() and DBG_PAUSE_IF(). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [xhci] Avoid accessing beyond end of endpoint context arrayMichael Brown2017-03-211-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [mucurses] Attempt to fix use of uninitialised buffer with strcat()Michael Brown2017-03-211-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [http] Add missing check for memory allocation failureMichael Brown2017-03-211-0/+5
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [eoib] Avoid passing a NULL I/O buffer to netdev_tx_complete_err()Michael Brown2017-03-211-1/+2
| | | | | | | | | Report errors in eoib_duplicate() via netdev_tx_err() rather than netdev_tx_complete_err(), since netdev_tx_complete_err() accepts only valid I/O buffers that are currently in the network device's transmit queue. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [slam] Avoid NULL pointer dereference in slam_pull_value()Michael Brown2017-03-211-5/+9
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [slam] Fix resource leak on error pathMichael Brown2017-03-211-4/+10
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [hyperv] Fix resource leaks on error pathMichael Brown2017-03-211-5/+11
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [mucurses] Attempt to fix resource leaksMichael Brown2017-03-211-6/+4Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [mucurses] Attempt to fix keypress processing logicMichael Brown2017-03-211-4/+3Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [mucurses] Attempt to fix test for empty stringMichael Brown2017-03-211-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [usb] Use correct length for memcpy()Michael Brown2017-03-211-1/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [librm] Fail gracefully if asked to ioremap() a zero lengthMichael Brown2017-03-211-1/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Free correct pointer on the error pathMichael Brown2017-03-211-3/+4
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [802.11] Remove redundant NULL pointer check after dereferenceMichael Brown2017-03-211-3/+0Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [sis900] Remove extraneous memset() with incorrect lengthMichael Brown2017-03-211-2/+1Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [qib7322] Use correct length for memset()Michael Brown2017-03-211-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linda] Use correct length for memset()Michael Brown2017-03-211-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [nfs] Fix double free bug on error pathMichael Brown2017-03-211-6/+1Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [xfer] Ensure va_end() is called on failure pathMichael Brown2017-03-211-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [arbel] Avoid potential integer overflow when calculating memory mappingsMichael Brown2017-03-211-1/+1
| | | | | | | | When the area to be mapped straddles the 2GB boundary, the expression (high+size) will overflow on the first loop iteration. Fix by using (end-size), which cannot underflow. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [hermon] Avoid potential integer overflow when calculating memory mappingsMichael Brown2017-03-211-1/+1
| | | | | | | | When the area to be mapped straddles the 2GB boundary, the expression (high+size) will overflow on the first loop iteration. Fix by using (end-size), which cannot underflow. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dhcp] Allow vendor class to be changed in DHCP requestsMichael Brown2017-03-203-11/+34
| | | | | | | Allow the DHCPv4 vendor class to be specified via the "vendor-class" setting. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [undi] Move PXE API caller back into UNDI driverMichael Brown2017-03-195-367/+300Star
| | | | | | | | | | | | | | As of commit 10d19bd ("[pxe] Always retrieve cached DHCPACK and apply to relevant network device"), the UNDI driver has been the only user of pxeparent_call(). Remove the unnecessary layer of abstraction by refactoring this code back into undinet.c, and fix the ability of undiisr.S to fall back to chaining to the original handler if we were unable to unhook our own ISR. This effectively reverts commit 337e1ed ("[pxe] Separate parent PXE API caller from UNDINET driver"). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Skip cable detection at initialisation where possibleMichael Brown2017-03-191-23/+19Star
| | | | | | | | | | | | | | | | | | We currently request cable detection in PXE_OPCODE_INITIALIZE to work around buggy Emulex drivers (see commit c0b61ba ("[efi] Work around bugs in Emulex NII driver")). This causes problems with some other NII drivers (e.g. Mellanox), which may time out if the underlying link is intrinsically slow to come up. Attempt to work around both problems simultaneously by requesting cable detection only if the underlying NII driver does not support link status reporting via PXE_OPCODE_GET_STATUS. (This is based on a potentially incorrect assumption that the buggy Emulex drivers do not claim to report link status via PXE_OPCODE_GET_STATUS.) Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Provide ACPI table description for SAN devicesMichael Brown2017-03-131-0/+69
| | | | | | | | | Provide a basic proof of concept ACPI table description (e.g. iBFT for iSCSI) for SAN devices in a UEFI environment, using a control flow that is functionally identical to that used in a BIOS environment. Originally-implemented-by: Vishvananda Ishaya Abrams <vish.ishaya@oracle.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add EFI_ACPI_TABLE_PROTOCOL header and GUID definitionMichael Brown2017-03-104-0/+137
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Update to current EDK2 headersMichael Brown2017-03-1014-44/+1233
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Provide common ARRAY_SIZE() definitionMichael Brown2017-03-109-19/+9Star
| | | | | | | Several files define the ARRAY_SIZE() macro as used in Linux. Provide a common definition for this in include/compiler.h. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [iscsi] Don't close when receiving NOP-InVishvananda Ishaya Abrams2017-03-091-9/+8Star
| | | | | | | | | | | Some iSCSI targets send NOP-In. Rather than closing the connection when we receive one, it is more user friendly to log a debug message and keep the connection open. Eventually, it would be nice if iPXE supported replying to NOP-Ins, but we might as well keep the connection open until the target disconnects us. Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [intel] Reset all virtual function settingsVishvananda Ishaya2017-03-094-13/+91
| | | | | | | | | | | Some VF data is not cleared with reset, so make sure to return all the settings to default before configuring the VF. This fixes an issue where network packets would fail to be received if the VF was previously used by the linux ixgbevf driver. Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [scsi] Avoid duplicate calls to scsicmd_close()Michael Brown2017-03-091-8/+7Star
| | | | | | | | | | | | | | | | When a SCSI device is closed in error, the shutdown of the device's block data interface will probably lead to any outstanding commands being closed (by whichever object is currently connected to the block data interface). However, commands remain in the list of outstanding commands until the final reference is dropped. The result is that scsidev_close() will make a second call to scsicmd_close() for each command. This is harmless, but produces confusing debug messages. Fix by treating the outstanding command list as holding an explicit reference to each command, and removing the command from the list of outstanding commands in scsicmd_close(). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [block] Use intfs_shutdown() when shutting down multiple interfacesMichael Brown2017-03-091-2/+1Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [scsi] Use intfs_shutdown() when shutting down multiple interfacesMichael Brown2017-03-091-5/+3Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>