Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp2933454rdh; Mon, 27 Nov 2023 02:42:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IGzyW76XP24QgFrMjIt+cNpP9RJvaauImWFJ6lbKtkjaNEl+fnbfVZw+XYOVww3asd3fvNF X-Received: by 2002:a17:902:da90:b0:1cc:4468:f1cf with SMTP id j16-20020a170902da9000b001cc4468f1cfmr11764721plx.3.1701081763821; Mon, 27 Nov 2023 02:42:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701081763; cv=none; d=google.com; s=arc-20160816; b=IFbTG99zn1wVuqcNC0q27kwqjzHosDR14c5aW1pi+xCx1OqOuSzHUzWv0hlhuwZeik V2SpFYxUlXYTlwIFV6vDizLTEtTXZkECWIETM8Y4KxYfmjuof4mqDj7X7xFPuMzCmCMo fYN5ZM7dUgtGila2qSR+TNK2ua7SENQHZ8YPE2ORgR/GrmRtfZVdGh2VG/JQLRjJGEuf IHtod6WPkugLWe4Ad2Mdkx6S+YzVh6oQtrU4HVY9ZGMJ8PbOI//rMB92IeM8uIQcSAA8 2fKlCeA7k30UZ+jWSBa48TMyJH2C/3P3EhLHD0KlZcG+lg0spMXl8yLivAVEQhrMoJEi Qy/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from; bh=V+EjsZSFmh3IHgED/1feKLeTW0fK3ReAleqU13NOeaQ=; fh=CzLBOT1Medj8LxjG7hqiavETYd+EvFnAG67M2ADifCI=; b=en7JWjpqXMmKHy4V7IW6jfWnFKluon+/vSXS1BcSrQb9XN+RJikDo3U3PnlbSz1lTD g/HGB6TNkTvF0heAJVY0nh7ENxaPmW8aq5+lbI3I0x7SfouN4wMtlPMqZyaO6/8MRXir opLOCaGfJSTo50/D4vE8d9CNx9lWtV7qxQ7ZnpsCS0K32PPhG7Z+Zcqw+kLol9h0lZb5 pxA/20+xioz1MPbvZWniEFDaabZaSHpbT4S6b8SsJhazpsnDPex7mAwBieiIQciQSpCJ gG+QMFDm4bOtS7sepMmMgVQDQxv3nBIAEg/5/V1Hhl5YaWtMz2exlDBIebUtcU95nHUp 8MTg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id u11-20020a170903124b00b001cf7c07be54si9671688plh.507.2023.11.27.02.42.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 02:42:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 3EDFC80764A2; Mon, 27 Nov 2023 02:42:36 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232976AbjK0KmV (ORCPT + 99 others); Mon, 27 Nov 2023 05:42:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233090AbjK0KmN (ORCPT ); Mon, 27 Nov 2023 05:42:13 -0500 Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F43819A for ; Mon, 27 Nov 2023 02:42:13 -0800 (PST) Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4Sf2GB1VjKz1qtrG; Mon, 27 Nov 2023 11:42:10 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 4Sf2GB03Yzz1qqlc; Mon, 27 Nov 2023 11:42:09 +0100 (CET) X-Virus-Scanned: amavis at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavis, port 10024) with ESMTP id tm617zSg7y19; Mon, 27 Nov 2023 11:42:09 +0100 (CET) X-Auth-Info: +DnrhnZblEGlOzb3XeBn1Jt2rs2WUKWMccr42/2aPU5JxxGUkqgQeHc3hbITbzys Received: from igel.home (aftr-62-216-205-201.dynamic.mnet-online.de [62.216.205.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Mon, 27 Nov 2023 11:42:09 +0100 (CET) Received: by igel.home (Postfix, from userid 1000) id CE2AA2C1CD6; Mon, 27 Nov 2023 11:42:08 +0100 (CET) From: Andreas Schwab To: Charlie Jenkins Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , Ron Economos , Samuel Holland , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/2] riscv: Safely remove entries from relocation list In-Reply-To: <20231122-module_linking_freeing-v3-1-8e9e412a3305@rivosinc.com> (Charlie Jenkins's message of "Wed, 22 Nov 2023 15:31:41 -0800") References: <20231122-module_linking_freeing-v3-0-8e9e412a3305@rivosinc.com> <20231122-module_linking_freeing-v3-1-8e9e412a3305@rivosinc.com> X-Yow: Are we live or on tape? Date: Mon, 27 Nov 2023 11:42:08 +0100 Message-ID: <87bkbfzddr.fsf@igel.home> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Mon, 27 Nov 2023 02:42:36 -0800 (PST) On Nov 22 2023, Charlie Jenkins wrote: > @@ -683,17 +700,29 @@ int add_relocation_to_accumulate(struct module *me, int type, void *location, > > if (!found) { > rel_head = kmalloc(sizeof(*rel_head), GFP_KERNEL); > + > + if (!rel_head) > + return -ENOMEM; > + > rel_head->rel_entry = > kmalloc(sizeof(struct list_head), GFP_KERNEL); > + > + if (!rel_head->rel_entry) > + return -ENOMEM; This leaks rel_head on error. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."