From patchwork Tue Feb 20 15:35:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 13564179 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9EC4276031 for ; Tue, 20 Feb 2024 15:35:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708443346; cv=none; b=U7YH89bzgKt3kM3lUyQ2PXzYNH6R/Fd91cY19CMVuynEGULK53zyP1R3MZGf0eaiIjEwHjIP5f5vbPZCKwV+JkzJD7EbiNNT2EzcV4h9VTwUs6MWkVDMIkHFzSJhK+Y8QydBKQPm67A6s7BLqTibRURVP6tMjQ2EmQnFv8f3FKQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708443346; c=relaxed/simple; bh=LdGB2B5rFcC5/PxIMzBPHrC3fcULAF8gRB14YAlPNqg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZOoK4nMm0RXIM9PS0oSoz9LWld3gHr619pvN4JZOrv/M9xDH6B6ZW3kf/ew2patgnebvhvjhJYLd0xK2x1XNS9DOkOL1njSnVwU1I0g8DZ+8SuQDskW8PNwLKwpd0HuFGShMerljxaQq2T0NIui1QTNcQ3NMQfMaylFaVybuMEg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=kUY0i7lc; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="kUY0i7lc" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-4126f48411dso4690275e9.0 for ; Tue, 20 Feb 2024 07:35:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708443343; x=1709048143; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Jrtujh/LnXfvYMR2N2cwo9zSO80+VM2HiXhsn02tIjQ=; b=kUY0i7lcs8xyQhIGX2nEAHG+cGiDpXoOnGMtCs6PDATpuOYWewp8T9uGie7EUa2Jd6 BiayhkagUFk0ANspLxlfiW23DJdlif8RH/FpS2jZ7XMlZKQAETitfYvEDUlabOPRYvfs v3uEhHIzyx/WUiltYlYugYmUJmOI5kkRoaNSOipLUJzrsj0Oq+c1jWmq9xyfdnQCMR69 6J+ofmKZyYOL5XZJs0WwU5LoZVmu/LNpmx5vI67agWGfdrA5J9BJd7Guf+pMe+eCM+I8 yS5qGuUxZsc26jPCBotqYJ2vGQJjdZ7AN65qPzSf5NlDydRLii4/eg+iKdyvW+NKLTnd uCEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708443343; x=1709048143; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Jrtujh/LnXfvYMR2N2cwo9zSO80+VM2HiXhsn02tIjQ=; b=FmVy/ljgGpHOgH2Dl+VLID2O0OVrYKe2BRm8n4XV3+jsTeLrRF2LsZMqEoBlWaN4oD 21VbYjE+gUdSjkaXonJirXU8RJoPSjbYuHOgHVSQPl2jroTUw+FoQwxn2eyXuWsY3g1D VCakkSeFqbJ78bGTLpQWpwUBpQHkW8H4ChLJQf6rJ7RMidf5Jj7V9QRaCnIAnAnbdtVY BLwRf+Fjje+TFPXWEe20vXzFWMAW2iiTh3vpeBjGanQ5pdu15lfZOihzoDVOYfQU2pzR 0FrAkf0wtSNb8VZ58zXTWm90BB5RLqyzKUn5Q7MFTFudadywQgnW2qI8uAWHWJDJ1+l/ PR6A== X-Forwarded-Encrypted: i=1; AJvYcCXHDOsqb5jOXjTibsPLVyl+HuEwoejkDt2LYX26F8LVQLlyKDh8XO2GEGi0ZSCKbGUztrIrpCRZIrvSRT9RoT1bkGZFMO+I3kMxrEU= X-Gm-Message-State: AOJu0YxlpC8rGlenTlmvkXQeu6d7bhUKh2RK5Yh4tSrAqVTNVvciFhUv QEwMP/LLPqfy+B0DQQuW5PzsZh2HgGNARB1xt1mbuhBQtMRNdo2rcxuk4wOe1fI= X-Google-Smtp-Source: AGHT+IFDWLykrLrTZHAk/OiKu/p48Obi7ksW8/C3NaF3BGJJllJTfI+C8R5qCg4lbmEjSwL/2SNd8Q== X-Received: by 2002:a05:600c:3ac8:b0:412:6ebe:9ecd with SMTP id d8-20020a05600c3ac800b004126ebe9ecdmr2032288wms.3.1708443343086; Tue, 20 Feb 2024 07:35:43 -0800 (PST) Received: from aspen.lan (aztw-34-b2-v4wan-166919-cust780.vm26.cable.virginm.net. [82.37.195.13]) by smtp.gmail.com with ESMTPSA id g8-20020a05600c310800b004126ec2f541sm2444905wmo.0.2024.02.20.07.35.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 07:35:41 -0800 (PST) From: Daniel Thompson To: Lee Jones , Jingoo Han Cc: Daniel Thompson , Luca Weiss , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH RESEND 1/4] backlight: da9052: Fully initialize backlight_properties during probe Date: Tue, 20 Feb 2024 15:35:24 +0000 Message-ID: <20240220153532.76613-2-daniel.thompson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240220153532.76613-1-daniel.thompson@linaro.org> References: <20240220153532.76613-1-daniel.thompson@linaro.org> Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 props is stack allocated and the fields that are not explcitly set by the probe function need to be zeroed or we'll get undefined behaviour (especially so power/blank states)! Fixes: 6ede3d832aaa ("backlight: add driver for DA9052/53 PMIC v1") Signed-off-by: Daniel Thompson --- drivers/video/backlight/da9052_bl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/video/backlight/da9052_bl.c b/drivers/video/backlight/da9052_bl.c index 1cdc8543310b4..b8ff7046510eb 100644 --- a/drivers/video/backlight/da9052_bl.c +++ b/drivers/video/backlight/da9052_bl.c @@ -117,6 +117,7 @@ static int da9052_backlight_probe(struct platform_device *pdev) wleds->led_reg = platform_get_device_id(pdev)->driver_data; wleds->state = DA9052_WLEDS_OFF; + memset(&props, 0, sizeof(struct backlight_properties)); props.type = BACKLIGHT_RAW; props.max_brightness = DA9052_MAX_BRIGHTNESS; From patchwork Tue Feb 20 15:35:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 13564180 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4DBF376047 for ; Tue, 20 Feb 2024 15:35:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708443347; cv=none; b=fs0yqbu8OMh8P59JYxEMg5GjBHWe6r68lfarxnKX8aNxcHSK7uy40Dy1vb1jMgttckIJ9jcXIDUzq1dQHq2crT7kpy+/fWCNmYPcSlSEiARfGlSwuPeXw/TEIQzlkYNtD1mXJT91sP8nt92EREi6jSw6QSe7dd5N2YxNalpDcq0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708443347; c=relaxed/simple; bh=O1s6f0aVlfXsIZe84Tbyl+6qx99iwWHj2GqrxpYofNE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nqGrnZjHS6Z0OsyqSDYyExn5fZOjz3BnxbMWXaeBSaTg4sElLxTSY06uFR7FMUwtSf98dCWbxzyVZYRwY2lTVo287FWB8lhFnzDzDNZiBtj7/5jSgjHVwsJBn+2RjNGT0SFEWqwdowuubHxzI5mrpK9Oon9LA8eSK+Tiaxe2YQE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=A49fnGSF; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="A49fnGSF" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-4126f486429so5581265e9.0 for ; Tue, 20 Feb 2024 07:35:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708443343; x=1709048143; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Dg9eYBATJE28KVVYL5JHYrMeYFjWDGTymWB+eHLR51Y=; b=A49fnGSFiIMUaweEaPKUd6QHs1z8WahFQvp8dNyIcW9wpWfWFd2pKWwpCxYEyVejeN ejOSqBBZKU8ynUhhYl076di+o4ntEEdz1UI7m689xVlDjaMPRWrPnKDGyE7D80yrZIn2 fi5fkQFN9QI/zI90ZulWgsKtp2T+W9OnKjK3lto9WHpRf8MXD2hTMxXDM3KBth7eYhrK uiViPRzm1rhe67dBpceWcm7iRkXbctJFzzXIe6LqJAzlwDX/DYzdPaPqyLDsSMI6JnMV /dFpgDoBkGGeXpKYCUWZvH+Eneu0XtgoU1RjOS4oKyE9RCgUgfybCcdjbit9k8pyIdp4 czUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708443343; x=1709048143; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Dg9eYBATJE28KVVYL5JHYrMeYFjWDGTymWB+eHLR51Y=; b=BOowFsqg4mlwrC7KfpVLORXA83AYJgQexZx9w23vs2mXggJNHzXtjHvgd2hhMlPSMr R2Yo5J0ecA3uv0FzyYrkURKv2M8Fk/RAtaLFsW7n4v/ln46RqhDCBnomMqOxiQca2Cg9 r5tO68R92jVWGgDZZ7DtLo0nDcLmV4FdgXBuSvWIgFojjiFFOlj8LU4XTrVTuJnUgJN2 qKkhN8sMYV706poM0YAGRS+gGz/BS8wPSpaavA6tpVRXILP2JcIISY4HPjOv4VkSlz9R qWq/FZcjtLa2VelLg934i8I9ikf2wim+NpEJB1HehGWb9uUrSfGIaTPVJeT8sxgcLqzN 4M4w== X-Forwarded-Encrypted: i=1; AJvYcCXkATtzQwBNo3KLrAt0nvEIBtRcMc9zU2uJq9fm3fI+FdIoKZqAUQ2q1tT090cb3/5L6pTs8ZFup/Zoe7wKEL5+MlUNGJJjQJMOEdE= X-Gm-Message-State: AOJu0Yy/BNO5q8sMbvsBgyCp5FXqfOrdbefIdDRSzoeP/RW1UD5WYfIe 3r3MSuYGqgwgvFtyTgUnASd45pWaN2yM1ymwxtFG3keioBzShO7wuioNuYMuPBw= X-Google-Smtp-Source: AGHT+IG8vq/wsIWwmwQlvm7aXyY0pdUfrR1TIk4qOIdiIiJ3ne1J8Iih0b1AG9jJ3O8+DPyJtcyN8A== X-Received: by 2002:a05:600c:1d24:b0:412:6574:c9a6 with SMTP id l36-20020a05600c1d2400b004126574c9a6mr5189419wms.2.1708443343754; Tue, 20 Feb 2024 07:35:43 -0800 (PST) Received: from aspen.lan (aztw-34-b2-v4wan-166919-cust780.vm26.cable.virginm.net. [82.37.195.13]) by smtp.gmail.com with ESMTPSA id g8-20020a05600c310800b004126ec2f541sm2444905wmo.0.2024.02.20.07.35.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 07:35:43 -0800 (PST) From: Daniel Thompson To: Lee Jones , Jingoo Han Cc: Daniel Thompson , Luca Weiss , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH RESEND 2/4] backlight: lm3639: Fully initialize backlight_properties during probe Date: Tue, 20 Feb 2024 15:35:25 +0000 Message-ID: <20240220153532.76613-3-daniel.thompson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240220153532.76613-1-daniel.thompson@linaro.org> References: <20240220153532.76613-1-daniel.thompson@linaro.org> Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 props is stack allocated and the fields that are not explcitly set by the probe function need to be zeroed or we'll get undefined behaviour (especially so power/blank states)! Fixes: 0f59858d5119 ("backlight: add new lm3639 backlight driver") Signed-off-by: Daniel Thompson --- drivers/video/backlight/lm3639_bl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/video/backlight/lm3639_bl.c b/drivers/video/backlight/lm3639_bl.c index 5246c171497d6..564f62acd7211 100644 --- a/drivers/video/backlight/lm3639_bl.c +++ b/drivers/video/backlight/lm3639_bl.c @@ -338,6 +338,7 @@ static int lm3639_probe(struct i2c_client *client) } /* backlight */ + memset(&props, 0, sizeof(struct backlight_properties)); props.type = BACKLIGHT_RAW; props.brightness = pdata->init_brt_led; props.max_brightness = pdata->max_brt_led; From patchwork Tue Feb 20 15:35:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 13564181 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1698876054 for ; Tue, 20 Feb 2024 15:35:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708443347; cv=none; b=n43qBr6mqzXxslL7i3xUzmPuFmjO9WsD7oBHJe2VQ++2B4QiSmmblK/y4oRzj/1n0OWJhRWqBl2Fh4ENwviPoLAaxCTpLg3tJgTtumk4VCNCi8weFABol4wZ/C8z2MfHKLykK4Ce3+yRxqTtIRGMTBap16TTBjrDgQibmYvPorA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708443347; c=relaxed/simple; bh=Bdr6esLRbtemkpFIIDa1y5ugHKxf8AG0iRZ2eQuhhuA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=P46+E9zL9eSEC0loy662ugHkakzYFjAi8qYKz6EGoUJemXvqF24eRpzaMwWWPGlkCJDxn32ugvrCEbrK1ODM4zqJsPcqB3GSU2vGpJpyaon9OcpnNoZdiIq/kdFgVSylp5hruDeRW99la84ugc6NA8f6wOnMQCaOfBQjoPmA+1A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=PgAcGyS4; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="PgAcGyS4" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-41272d42297so654095e9.3 for ; Tue, 20 Feb 2024 07:35:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708443344; x=1709048144; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CcW5EHUKgbIlTJ9AkvlcTH/1qNEKLD/WUfYuV6zpMeg=; b=PgAcGyS4m3MARmG7Pf4cdSb/D7vA5SIgtDC3mkRGsipnpN28tjNxL6hr4TLddZ67+P owTW1oZANz/ZlKYkHO/5e3704isLy+NMOwdchknQfdKTobcFnUZqwq4vQWsuNpsyjy4+ kOqbbbrifaStO8sjkSDeKL6PDPtYkA9/3XcbYeP+AwF28r4fwcKVHdSmIFWArQ76I/aK KUWiYgIR7qElJzu829Qr4ety3HPG3HHObTGjuieMREW0xD+rSimDmwazbNqkFZrPzPMH vQshWmrTkOubhq2odNcaQuTNYK2RtNDLqKnkW5OXcsO1j8nBiLreHYjjqzFeFjzvnj1I hagA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708443344; x=1709048144; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CcW5EHUKgbIlTJ9AkvlcTH/1qNEKLD/WUfYuV6zpMeg=; b=mBgr2GugbCNF1OzzfLiRx2eDXpJfx1fSqdV4DUUZq8xqa4apsPsOkBXD6krxI9FsFR aZWsgetCWY/XU1+xB5BprGIGWBhR9vBMmVUK/ursLO3q/FVaoR/GosIZjuseiP67X00J 4PsAMbgmI2nFQOpauH2Gd/jxQuyNgqnt8a0tV69P69JX98V8pWSpFGWiBosdoTIF/OE0 hfe7dSzBh2qK57LHsjOtuUHKjjm2XDI8loLhLpQYsm2MfkjWtGLjTk6Y+4RdOGkKddNa PkApAXR5/zCqsKgf9M54vFuSpWa8jrnpnCq6Vo/O76yTZtE+lm0zASyEPnaseWQMJWy3 DBrg== X-Forwarded-Encrypted: i=1; AJvYcCXVv4YN3lhXVuBTBWl6+hmVNszJ1fUlgDIL7kxbnuZ7TklsWFstxb4K708SduJ5da6/aREOGtXCKYDGMabRRcykCGrmeyGKzEH/doc= X-Gm-Message-State: AOJu0YwLuzx1bouC3YeixN9MyZtD5KGK8qzgd3Qkrn26NH6aig1y0E57 bi/zMqCXHaHdPSqwpM9V0iiy4MuDfPGfzI4lxSHa9QYSd3MPoGOkoG+kEusDt5g= X-Google-Smtp-Source: AGHT+IEpCXV6NsmkOJ9aSe37i5U0I9NvAzq/Dog4zLeK5T/NulYxyznqCpuNmqivjX1f01yhov8nMw== X-Received: by 2002:a05:600c:314b:b0:412:71fb:7732 with SMTP id h11-20020a05600c314b00b0041271fb7732mr408200wmo.38.1708443344393; Tue, 20 Feb 2024 07:35:44 -0800 (PST) Received: from aspen.lan (aztw-34-b2-v4wan-166919-cust780.vm26.cable.virginm.net. [82.37.195.13]) by smtp.gmail.com with ESMTPSA id g8-20020a05600c310800b004126ec2f541sm2444905wmo.0.2024.02.20.07.35.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 07:35:44 -0800 (PST) From: Daniel Thompson To: Lee Jones , Jingoo Han Cc: Daniel Thompson , Luca Weiss , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH RESEND 3/4] backlight: lp8788: Fully initialize backlight_properties during probe Date: Tue, 20 Feb 2024 15:35:26 +0000 Message-ID: <20240220153532.76613-4-daniel.thompson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240220153532.76613-1-daniel.thompson@linaro.org> References: <20240220153532.76613-1-daniel.thompson@linaro.org> Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 props is stack allocated and the fields that are not explcitly set by the probe function need to be zeroed or we'll get undefined behaviour (especially so power/blank states)! Fixes: c5a51053cf3b ("backlight: add new lp8788 backlight driver") Signed-off-by: Daniel Thompson --- drivers/video/backlight/lp8788_bl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/video/backlight/lp8788_bl.c b/drivers/video/backlight/lp8788_bl.c index d1a14b0db265b..31f97230ee506 100644 --- a/drivers/video/backlight/lp8788_bl.c +++ b/drivers/video/backlight/lp8788_bl.c @@ -191,6 +191,7 @@ static int lp8788_backlight_register(struct lp8788_bl *bl) int init_brt; char *name; + memset(&props, 0, sizeof(struct backlight_properties)); props.type = BACKLIGHT_PLATFORM; props.max_brightness = MAX_BRIGHTNESS; From patchwork Tue Feb 20 15:35:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 13564182 Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4CFC3762E8 for ; Tue, 20 Feb 2024 15:35:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708443349; cv=none; b=u8aXoaA8yMmHuzwpeLeqyoB/jhVOFK0sn3O9/MWIbF6uCQALORhBfqW/j5lGCnPfXoLA8RKkK07PoU5RrjF+3Wg9uRNcxLD+kEN+urqaD5I3H0bI5MEjYkJQbLTZMZbCW2gFZzqXdRZbktJPcGbdbVwySUGV1cW5rj/xLI9Nvmk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708443349; c=relaxed/simple; bh=qYHC0DIL9EkTejQxo0dNu3EOioYY1QzCa+VXZLu5HiY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=M9NrlGfbbi+l4GObohAlgQ3HjQmPN5s+3MpjbHRnTCsjng+wMKiwOyZNMLigu/MvKx0QiGmsboujFUQC+bTMDt/05ogXi+tyHOsX8rhEH5NiG0NmHAlb558ARRmHMqf9uqwcDW9hsVtlsXtEt0EOqgadiK2iFZeKtbM0SYQYidQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=UC6QvBg+; arc=none smtp.client-ip=209.85.221.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="UC6QvBg+" Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-33d146737e6so3483885f8f.0 for ; Tue, 20 Feb 2024 07:35:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708443345; x=1709048145; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YwLWP4/vhF0uIJPtwS5+bkpQQd9v2zac6pd8EH25YT0=; b=UC6QvBg+3Mdb1lYH1E5enNvjiZPxjrCQyYs3NLvC0W1tVnAJ6SXsCZo3xouUod+3KH kP306Ihacy5zZvwIliTSIPMUAIEZzMRj5njuTeuRvHFYCed9aPC3aYrohNlXSSrbcwft 3Nl47kCynpL68MPaqc9A6PAVLj/KIE30nxo++oBguSs4o6uKPGmffGYW547FXdJiYwyR mplMzkYsAB2oIYEHBxGMzNWw7zhMC1udcVF+GiLPtc0oQLYknIWPz5tKrwrUJdMNIzWq Cq7SYGQEMRHFUn57Lw91iXsEr1kMdtvCwTb1Qd3h4v/eQXbKdgQN2Rt6QPAqyFOj/vSu 2jhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708443345; x=1709048145; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YwLWP4/vhF0uIJPtwS5+bkpQQd9v2zac6pd8EH25YT0=; b=d5Szj+u2Ehh65hVpWV6VpwbHgnaSWsnQJMYhGURyxaL/3Iz7hbPfmC75TfamUqZcE3 U6c5gQTbp93ArDy8uiCH+uOKKVvjBZWiqUXeGxSCpER1fAtVLLGzks56mK8e9zgJHLut Br91nQ8c/XiPazrrFOAH59MIW4A6VCt0h2T3hx3WmC/p2kvoi0raH0cQ+QUjz3A53sv/ VteKOQNs6M2U6A+SXkTXN+FsYviGULrjHKm9U4pg4zxNAnRcypMZtaNNhn2aWD59p8Vz 5yhbSBZtHBMQdXuQwmNz7TrL3g57lS9F/Jnhfh+PqOhQkd/610G3yFlyhaTOghI7ZkcO WpIQ== X-Forwarded-Encrypted: i=1; AJvYcCXc22Rq8VW+j8U0VdjP6hrYpgPFr0LCojHy4uSkZkiC4ZNGfvyTzs/tZuny1DBinc95CqUV1qQJ+GmUcxEx8WgqU0C0irTLZCIwD3E= X-Gm-Message-State: AOJu0YybfISk21ntCETnPLPr301ZoI7ytHpo429rFYiZkKCb/O/F4PeQ zTkGKHt3Lr7rLqEi81qE6wis6Oe9uC5xmrYIW2cRuklOelVVVgYacaxd/y7NTTo= X-Google-Smtp-Source: AGHT+IEMn5UIvIGN8ynNgBG1UECcP3133jvG/f9Bq3NQkmhEynvf2+SdDbQmpD5zbEoioW5xKTd9vA== X-Received: by 2002:a5d:414e:0:b0:33d:1427:5274 with SMTP id c14-20020a5d414e000000b0033d14275274mr10295254wrq.52.1708443345703; Tue, 20 Feb 2024 07:35:45 -0800 (PST) Received: from aspen.lan (aztw-34-b2-v4wan-166919-cust780.vm26.cable.virginm.net. [82.37.195.13]) by smtp.gmail.com with ESMTPSA id g8-20020a05600c310800b004126ec2f541sm2444905wmo.0.2024.02.20.07.35.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 07:35:44 -0800 (PST) From: Daniel Thompson To: Lee Jones , Jingoo Han Cc: Daniel Thompson , Luca Weiss , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH RESEND 4/4] backlight: mp3309c: Fully initialize backlight_properties during probe Date: Tue, 20 Feb 2024 15:35:27 +0000 Message-ID: <20240220153532.76613-5-daniel.thompson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240220153532.76613-1-daniel.thompson@linaro.org> References: <20240220153532.76613-1-daniel.thompson@linaro.org> Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 props is stack allocated and, although this driver initializes all the fields that are not "owned" by the framework, we'd still like to ensure it is zeroed to avoid problems from this driver if the fields change. Signed-off-by: Daniel Thompson --- drivers/video/backlight/mp3309c.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/video/backlight/mp3309c.c b/drivers/video/backlight/mp3309c.c index 34d71259fac1d..cdf302d6f1cb5 100644 --- a/drivers/video/backlight/mp3309c.c +++ b/drivers/video/backlight/mp3309c.c @@ -373,6 +373,7 @@ static int mp3309c_probe(struct i2c_client *client) chip->pdata = pdata; /* Backlight properties */ + memset(&props, 0, sizeof(struct backlight_properties)); props.brightness = pdata->default_brightness; props.max_brightness = pdata->max_brightness; props.scale = BACKLIGHT_SCALE_LINEAR;