diff options
author | Stuart Haslam <stuart.haslam@linaro.org> | 2015-04-02 12:11:56 +0100 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2015-04-03 14:56:45 +0300 |
commit | 8b5269aad139def070890f1d05a25be9b51c0976 (patch) | |
tree | bab4beacc25c00bde069539b120f2bbffa18a0f6 /platform/linux-generic | |
parent | f639f626a7cf6c198f0ea4b649d7b86d2026f14b (diff) |
linux-generic: pool: check for NULL params before dereference
Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org>
Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'platform/linux-generic')
-rw-r--r-- | platform/linux-generic/odp_pool.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c index 468b7a52b..bf49623f4 100644 --- a/platform/linux-generic/odp_pool.c +++ b/platform/linux-generic/odp_pool.c @@ -143,6 +143,9 @@ odp_pool_t odp_pool_create(const char *name, pool_entry_t *pool; uint32_t i, headroom = 0, tailroom = 0; + if (params == NULL) + return ODP_POOL_INVALID; + /* Default size and align for timeouts */ if (params->type == ODP_POOL_TIMEOUT) { params->buf.size = 0; /* tmo.__res1 */ @@ -158,9 +161,6 @@ odp_pool_t odp_pool_create(const char *name, _odp_buffer_pool_init_t *init_params = &default_init_params; - if (params == NULL) - return ODP_POOL_INVALID; - /* Restriction for v1.0: All non-packet buffers are unsegmented */ int unseg = 1; |