diff options
author | Alex Shi <alex.shi@linaro.org> | 2017-11-16 12:03:04 +0800 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2017-11-16 12:03:04 +0800 |
commit | d983367513927b1e964689c3686255301f9f1c16 (patch) | |
tree | 496ffc618a8021fbdab41120ba2a0b1d1febca3f /lib | |
parent | 7effd4c8ef8779ef8dcb90b5dc3dd38c12210c11 (diff) | |
parent | c4e3d53bd9e7e7723f351dba998151eca4725af6 (diff) |
Merge tag 'v4.4.98' into linux-linaro-lsk-v4.4
This is the 4.4.98 stable release
Diffstat (limited to 'lib')
-rw-r--r-- | lib/asn1_decoder.c | 4 | ||||
-rw-r--r-- | lib/test_firmware.c | 11 |
2 files changed, 10 insertions, 5 deletions
diff --git a/lib/asn1_decoder.c b/lib/asn1_decoder.c index faa2a3f017f8..4fa2e54b3f59 100644 --- a/lib/asn1_decoder.c +++ b/lib/asn1_decoder.c @@ -227,7 +227,7 @@ next_op: hdr = 2; /* Extract a tag from the data */ - if (unlikely(dp >= datalen - 1)) + if (unlikely(datalen - dp < 2)) goto data_overrun_error; tag = data[dp++]; if (unlikely((tag & 0x1f) == ASN1_LONG_TAG)) @@ -273,7 +273,7 @@ next_op: int n = len - 0x80; if (unlikely(n > 2)) goto length_too_long; - if (unlikely(dp >= datalen - n)) + if (unlikely(n > datalen - dp)) goto data_overrun_error; hdr += n; for (len = 0; n > 0; n--) { diff --git a/lib/test_firmware.c b/lib/test_firmware.c index 86374c1c49a4..841191061816 100644 --- a/lib/test_firmware.c +++ b/lib/test_firmware.c @@ -65,14 +65,19 @@ static ssize_t trigger_request_store(struct device *dev, release_firmware(test_firmware); test_firmware = NULL; rc = request_firmware(&test_firmware, name, dev); - if (rc) + if (rc) { pr_info("load of '%s' failed: %d\n", name, rc); - pr_info("loaded: %zu\n", test_firmware ? test_firmware->size : 0); + goto out; + } + pr_info("loaded: %zu\n", test_firmware->size); + rc = count; + +out: mutex_unlock(&test_fw_mutex); kfree(name); - return count; + return rc; } static DEVICE_ATTR_WO(trigger_request); |