VOL-1691 Fix openolt adapter getting stuck while registartion with core
Change-Id: Ide8131f325bc15f1b909e14d7af6ee9bcd6b3b5b
diff --git a/vendor/github.com/pierrec/lz4/decode_other.go b/vendor/github.com/pierrec/lz4/decode_other.go
index b83a19a..002519f 100644
--- a/vendor/github.com/pierrec/lz4/decode_other.go
+++ b/vendor/github.com/pierrec/lz4/decode_other.go
@@ -3,11 +3,10 @@
package lz4
func decodeBlock(dst, src []byte) (ret int) {
+ const hasError = -2
defer func() {
- // It is now faster to let the runtime panic and recover on out of bound slice access
- // than checking indices as we go along.
if recover() != nil {
- ret = -2
+ ret = hasError
}
}()
@@ -61,7 +60,7 @@
offset := int(src[si]) | int(src[si+1])<<8
if offset == 0 {
- return -2
+ return hasError
}
si += 2
@@ -90,6 +89,4 @@
}
di += copy(dst[di:di+mLen], expanded[:mLen])
}
-
- return di
}