Message ID | 20200503024637.327733-12-seanga2@gmail.com |
---|---|
State | Superseded |
Delegated to: | Andes |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=MHw1M3G6; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49F9SM38MLz9sRf for <incoming@patchwork.ozlabs.org>; Sun, 3 May 2020 12:49:39 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 18FE1821B3; Sun, 3 May 2020 04:47:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="MHw1M3G6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 62A9581EE2; Sun, 3 May 2020 04:46:59 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 5F91681EBA for <u-boot@lists.denx.de>; Sun, 3 May 2020 04:46:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=seanga2@gmail.com Received: by mail-qt1-x843.google.com with SMTP id i68so11196147qtb.5 for <u-boot@lists.denx.de>; Sat, 02 May 2020 19:46:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JqpTI+R5u1R4y/N876rmleqbQjv+1J0JiV8cYqNQSjk=; b=MHw1M3G6B35XMEmYiUNugY4eM3gD4TPtVN82ixt+JjLweqWhvsL6q4Xh9yr5FGd9Re qFuj+KDCjP2EpX2dipCY4vkEu1m1NWaRgmpF/w/W95HyQ/j0wmfzkeUpqG9RePSuBjFo XXhMwB4Xc1p30o0jrBhNzci7zP6WFaFjP9W3w54bh1mnG+ITJcHrR2ACwzGaHCVSUgZm Ah/yCdv3GwMxqStViwuEt75icQVMBEx+cSmk3HHtSnAhr8TNaOmcvPsmigtmQ4y8JYAj caSDz6j7PxiHPAnBKEtyKG/pkEg6sE/Bmdv+kr+T5NcjdEOA6h2KjDP4ip6Z5r7Ln5Z/ grGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JqpTI+R5u1R4y/N876rmleqbQjv+1J0JiV8cYqNQSjk=; b=CSzC/v3D/+kvBoj6KOIsyMxcMdinB8ZKRjlbphUAH/eeGIZQlvILxTmeJAV8InQDOi joSyliaC64pwiYKU1iuClOYq3LdyZ7QWWfC74VWffasVBNaMsp1uYIi3o2oXn69DpMuT cOovYXWaAUHRv2YBUYnE0beMECoBY/LF8irbfig7OUYe4THVikDMOn9E0s5l5/IbaXg/ ComDGpvCX5QUwkXear6RN7VNqVC2lCnnc+iP0fRvXCQGm+zFDP3ik0orpYwWpC/jfB4e DhbcKw4UFqUniQ4uSnLyK8P+hvQCcIAKafjtJIcixkOiDzvAILLcHEkJ2OHTfpIQjlIw rvqw== X-Gm-Message-State: AGi0PuZduqfjLYoJCjxK3VMyQX+4gKs5P6/pIThEpVFjK4VdsroRytCh cUpXuPk+dMWZWb1r85Hu3sOurdeWIJs= X-Google-Smtp-Source: APiQypLdPE6y0guXTHPHsPTgQ020xn0HhPYMrl1i5tA5xwXswZ6YTaVut+K/aftlSv1RWZftisi4UA== X-Received: by 2002:ac8:303a:: with SMTP id f55mr2525013qte.270.1588474014026; Sat, 02 May 2020 19:46:54 -0700 (PDT) Received: from godwin.fios-router.home (pool-108-51-35-162.washdc.fios.verizon.net. [108.51.35.162]) by smtp.gmail.com with ESMTPSA id h2sm6610696qkh.91.2020.05.02.19.46.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 May 2020 19:46:53 -0700 (PDT) From: Sean Anderson <seanga2@gmail.com> To: u-boot@lists.denx.de Cc: Bin Meng <bmeng.cn@gmail.com>, Rick Chen <rickchen36@gmail.com>, Sean Anderson <seanga2@gmail.com>, Tom Rini <trini@konsulko.com> Subject: [PATCH v10 11/21] lib: Always set errno in hcreate_r Date: Sat, 2 May 2020 22:46:27 -0400 Message-Id: <20200503024637.327733-12-seanga2@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200503024637.327733-1-seanga2@gmail.com> References: <20200503024637.327733-1-seanga2@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <https://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean |
Series |
riscv: Add Sipeed Maix support
|
expand
|
diff --git a/lib/hashtable.c b/lib/hashtable.c index 907e8a642f..e9ac7e252e 100644 --- a/lib/hashtable.c +++ b/lib/hashtable.c @@ -109,8 +109,10 @@ int hcreate_r(size_t nel, struct hsearch_data *htab) } /* There is still another table active. Return with error. */ - if (htab->table != NULL) + if (htab->table != NULL) { + __set_errno(EINVAL); return 0; + } /* Change nel to the first prime number not smaller as nel. */ nel |= 1; /* make odd */ @@ -123,8 +125,10 @@ int hcreate_r(size_t nel, struct hsearch_data *htab) /* allocate memory and zero out */ htab->table = (struct env_entry_node *)calloc(htab->size + 1, sizeof(struct env_entry_node)); - if (htab->table == NULL) + if (htab->table == NULL) { + __set_errno(ENOMEM); return 0; + } /* everything went alright */ return 1;