@@ -384,7 +384,7 @@ int drm_legacy_agp_free_ioctl(struct drm_device *dev, void *data,
struct drm_agp_head *drm_legacy_agp_init(struct drm_device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev->dev);
- struct drm_agp_head *head = NULL;
+ struct drm_agp_head *head;
head = kzalloc(sizeof(*head), GFP_KERNEL);
if (!head)
@@ -942,7 +942,7 @@ int drm_atomic_get_property(struct drm_mode_object *obj,
static struct drm_pending_vblank_event *create_vblank_event(
struct drm_crtc *crtc, uint64_t user_data)
{
- struct drm_pending_vblank_event *e = NULL;
+ struct drm_pending_vblank_event *e;
e = kzalloc(sizeof *e, GFP_KERNEL);
if (!e)
@@ -695,7 +695,7 @@ static int exynos_drm_ipp_task_setup_buffers(struct exynos_drm_ipp_task *task,
static int exynos_drm_ipp_event_create(struct exynos_drm_ipp_task *task,
struct drm_file *file_priv, uint64_t user_data)
{
- struct drm_pending_exynos_ipp_event *e = NULL;
+ struct drm_pending_exynos_ipp_event *e;
int ret;
e = kzalloc(sizeof(*e), GFP_KERNEL);
@@ -789,7 +789,7 @@ nv17_tv_create(struct drm_connector *connector, struct dcb_output *entry)
{
struct drm_device *dev = connector->dev;
struct drm_encoder *encoder;
- struct nv17_tv_encoder *tv_enc = NULL;
+ struct nv17_tv_encoder *tv_enc;
tv_enc = kzalloc(sizeof(*tv_enc), GFP_KERNEL);
if (!tv_enc)
The NULL initialization of the pointers assigned by kzalloc() first is not necessary, because if the kzalloc() failed, the pointers will be assigned NULL, otherwise it works as usual. so remove it. Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com> --- drivers/gpu/drm/drm_agpsupport.c | 2 +- drivers/gpu/drm/drm_atomic_uapi.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_ipp.c | 2 +- drivers/gpu/drm/nouveau/dispnv04/tvnv17.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)