Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1608025pxv; Fri, 2 Jul 2021 07:55:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzh/xf1GbZa5i479qmRPez1TO8KFvM7dlUTq32QZ2GW+phKrJ+rjUArsqth2OzBn9pfEt5i X-Received: by 2002:a5e:c10e:: with SMTP id v14mr332593iol.158.1625237707061; Fri, 02 Jul 2021 07:55:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625237707; cv=none; d=google.com; s=arc-20160816; b=VGH++l0VQwt/ECz8Lq4eCfQtCdvpulx0atY8yD5e+niZGRtFXtiOGgbszxYHSJsPRr hnXVlj9YSw0DXQAJk94PMHJIWSwwyE+m1nlcK10L/quhhMmtcIwi5Yod3VnNKkwmyMqf yoRD0i6Rold1Hz2qoxueY6K2zcb84pIBR1jdx7RVtrPSjiZNnrJHvPFlExgjPuIClof6 pGncpQAwTPxBTyYHDg9OweGLfh8Dpxdxha1zQTc6gt8qsuAPLAyYJJGF1U8jL7oPEFS2 vbp9nzknma6R8VxkpJ6WTOk7cE1verICdh7G2/HpJxqoLFFewvY+ySmV7e0aP5NvfyOn rI1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:to:from:date:dkim-signature; bh=/PCl/PleBZTsH8zunBgGuzFmk4Ca8Tvt5r3eo4Zy03A=; b=0WYfUmMVqC9ktG1DuTybGARUo6/rk8hpX+mJdkR1JM50Ovh0LDRSRdoJhMlJTrqFEr beyO9UzxeJOYJ0hXDWaIl4fu5F3e3bgB2usXFW7UwQ2YMfwrMJ7ML23z2LcxvXMvy1Fr YDoIrgdFBkfWQdOawNUoFQLjKmrt/d053yyWQ8y4AhAk01h65NISRymZSVWZOWE5nI7a CQKBBkTqQSz6wCpMA45RqZeoCjzo2cLeP92WqJgD2SXJrW0KtcJczTJrAkSpYk59Bto2 ZoDieWqgtwSorHzgRCMWauKftsjCU6jMqKcWcaRExjHY8/Kt7/e2oRB5zr1pHjf5ygCm F9lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Zvx4trx0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e1si2896606ilu.2.2021.07.02.07.54.54; Fri, 02 Jul 2021 07:55:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Zvx4trx0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232431AbhGBNdx (ORCPT + 99 others); Fri, 2 Jul 2021 09:33:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232280AbhGBNdu (ORCPT ); Fri, 2 Jul 2021 09:33:50 -0400 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94E69C061762 for ; Fri, 2 Jul 2021 06:31:18 -0700 (PDT) Received: by mail-wm1-x336.google.com with SMTP id m9-20020a05600c3b09b02901f246b43bbeso6394806wms.3 for ; Fri, 02 Jul 2021 06:31:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition; bh=/PCl/PleBZTsH8zunBgGuzFmk4Ca8Tvt5r3eo4Zy03A=; b=Zvx4trx0T5UUwwZc7zAID+VpfV4MTSM07xo4EQdejZ85cTy0hG2qt+Hd3JshkaF+zs n4Ux9Ae59nC3Ibr2ZPEU7ncgILO2x6tgcFcSm5WB5QDV9r3HD95q6wrKZuB8X5tZEGNd RBJ5Xqt8uwSXkk7qiIkVW5eiGVXBeL3Jxnq/O62lWT5dUZPUpso9wmVH2ml7QNDxXfaL W9dZLEX89MyLBJtAZgaJ+C34ZelqExiLUzfHIVbcHnfJaWa+sBCEVhAQshWC38YVJTvl /dz2mrp8My/++kkWiqEU/Lj6xSku5vHRnNIe5+KCGV3D8VNawr/2RXkcIkZWEA9XuOv8 bnCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition; bh=/PCl/PleBZTsH8zunBgGuzFmk4Ca8Tvt5r3eo4Zy03A=; b=RVz3caUJp/6YaFMaDljyeDAEwMfA0qbpsLLCuy6GJJlCXsMKxIO0CQS3cG4yxc5d5f AjAtJN/H+F3tc1j5hHOEZnhOcTBJjkkjco4bF4f9LQnMeI4A4BqRP/zUIt9CvrXLG2hN yZm3UJi0hUH5fu6GGcuSqGVuf1FqSoY1/PnesAT38we7OQtsqObVA8Sf5fkandLKn4Pq 3a4TDTrj2HpDcYsIyxFnmwfindJDh3ZDPMjG+bT1ft5Fv4YvuHccL2zrpFmD5ut+J1v1 5wZYL1bXKAONq+1b/anjmGvzI9TCoo6EGqzqHrZJ1k+po0gMSZaLmTv8VC64MYa8yLVa duOg== X-Gm-Message-State: AOAM533tvt+wc+dIOvucPuAquLzqcJli9tGEXXoRueDIGrrNVOqMZgRr N5QFJvJ3TdymdSFTizqGr3KRPy4r+9NHvA== X-Received: by 2002:a05:600c:1c2a:: with SMTP id j42mr16265842wms.173.1625232677015; Fri, 02 Jul 2021 06:31:17 -0700 (PDT) Received: from pc ([196.235.73.129]) by smtp.gmail.com with ESMTPSA id y20sm12422210wmi.31.2021.07.02.06.31.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jul 2021 06:31:16 -0700 (PDT) Date: Fri, 2 Jul 2021 14:31:14 +0100 From: Salah Triki To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org Subject: [PATCH] dio: return -ENOMEM when kzalloc() fails Message-ID: <20210702133114.GA314157@pc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return -ENOMEM when kzalloc() fails in order to inform the caller of the failure. Signed-off-by: Salah Triki --- drivers/dio/dio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dio/dio.c b/drivers/dio/dio.c index 193b40e7aec0..4c06c93c93d3 100644 --- a/drivers/dio/dio.c +++ b/drivers/dio/dio.c @@ -219,7 +219,7 @@ static int __init dio_init(void) /* Found a board, allocate it an entry in the list */ dev = kzalloc(sizeof(struct dio_dev), GFP_KERNEL); if (!dev) - return 0; + return -ENOMEM; dev->bus = &dio_bus; dev->dev.parent = &dio_bus.dev; -- 2.25.1