Message ID | 20200624104125.363509-11-seanga2@gmail.com |
---|---|
State | Accepted |
Commit | 60ffcf218fb2ed73dac1bd44ef0d45661b7577db |
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=2a01:238:438b:c500:173d:9f52:ddab:ee01; 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=tukI4NsE; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (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 49sKWk5Dkdz9sQt for <incoming@patchwork.ozlabs.org>; Wed, 24 Jun 2020 20:44:02 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6364D82060; Wed, 24 Jun 2020 12:42:48 +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="tukI4NsE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 691248203E; Wed, 24 Jun 2020 12:42:13 +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-qk1-x743.google.com (mail-qk1-x743.google.com [IPv6:2607:f8b0:4864:20::743]) (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 6E7F58202E for <u-boot@lists.denx.de>; Wed, 24 Jun 2020 12:42:02 +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-qk1-x743.google.com with SMTP id z63so1324047qkb.8 for <u-boot@lists.denx.de>; Wed, 24 Jun 2020 03:42:02 -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=GB+W2R40o6k9UDV10sxa5Xa3KvT8gt35A0ScHUXuqPs=; b=tukI4NsE3qFV5ZEcraH11xkjNxNRdC+D/1EkfQvGjth1SWK6omQcq71uJcztAwh+Zu ix69XejW9AMrAmDq7Vdkgj43qxJU2bjpY3Z+FjRhXULSipmN9VvnJ0JYlbVLOyELv+JQ H0Jv/Id6XN8Mk/Gwh5g0UtGaJUPDKP3xPkL3tkfPm1si5YSqZNpj+ZQ3aKYOv2SSOYyZ ui/JfjsCmkhpbbzQoyEm344Z2xeOTpuM6YH13iqHawI90LJHkX6KJZta0oEJKYqy57Kj iY0GGCZkAyXkETzj4R3XGHrU5zvxeYZ3PUsOBwdDzNgkZ4YjxLfXwEjphMINeF3fM4SP HEHg== 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=GB+W2R40o6k9UDV10sxa5Xa3KvT8gt35A0ScHUXuqPs=; b=Y0wnoygNAFN7kX+iVtrerMbnCRabj4vYjYZvZIqefkBVHf0ec9dVhg5EzeKUCA8Lj+ pPNTANYx3ifpkkULOO/ujXR8hdCB02fzCeJ8O7smiCTX7zqJTqcw919CFWbVNgrtSsU9 j5t5SiDEEXVAJgKFyqjzsKHkN7i+C58Rr2gVbD/IOsg9pr8qhH8qRFAozyVsL9M4WgNd mu2JnNjyTw3uJ7S1SP76X/M8ya1GmXnnrFCXpww6Vv1KQuEII92Ui1ei0gq+PpYlXe+r tA3x4/nuw9siEfGyGl0eydf6HBDqNgwdBPgEz6BBi3yH96OEzORuUMPOX+1rX99E2msP nBFw== X-Gm-Message-State: AOAM531HV5h31NcoReBZM58pp8m04XrHxeix7NfTqogIUumXW0XLcdg3 XQg2CziWVJmH7mRdSpzMIco4XHk++YY/8g== X-Google-Smtp-Source: ABdhPJw9OlkIVKHlXC5OPD8Tyu+0vbukQsCK/t8fFg29eft53RbdJQjMb+GugE76/4i0phAbE8ABrg== X-Received: by 2002:a05:620a:810:: with SMTP id s16mr23868249qks.360.1592995321144; Wed, 24 Jun 2020 03:42:01 -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 y40sm3438464qtc.29.2020.06.24.03.42.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 03:42:00 -0700 (PDT) From: Sean Anderson <seanga2@gmail.com> To: u-boot@lists.denx.de Cc: Rick Chen <rickchen36@gmail.com>, Bin Meng <bmeng.cn@gmail.com>, Sean Anderson <seanga2@gmail.com>, Tom Rini <trini@konsulko.com> Subject: [PATCH v14 10/20] lib: Always set errno in hcreate_r Date: Wed, 24 Jun 2020 06:41:15 -0400 Message-Id: <20200624104125.363509-11-seanga2@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200624104125.363509-1-seanga2@gmail.com> References: <20200624104125.363509-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 b96dbe19be..7b6781bc35 100644 --- a/lib/hashtable.c +++ b/lib/hashtable.c @@ -110,8 +110,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 */ @@ -124,8 +126,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;