Skip to content

Commit

Permalink
drm: Fixes linux-next & linux-2.6 checkstack warnings:
Browse files Browse the repository at this point in the history
drivers/gpu/drm/nouveau/nv40_graph.c: In function `nv40_graph_init':
drivers/gpu/drm/nouveau/nv40_graph.c:400: warning: the frame size of 1184 bytes is larger than 1024 bytes
drivers/gpu/drm/radeon/radeon_atombios.c: In function `radeon_get_atom_connector_info_from_supported_devices_table':
drivers/gpu/drm/radeon/radeon_atombios.c:857: warning: the frame size of 1872 bytes is larger than 1024 bytes

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Prarit Bhargava authored and Dave Airlie committed May 24, 2010
1 parent 5797660 commit f49d273
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
8 changes: 7 additions & 1 deletion drivers/gpu/drm/nouveau/nv40_graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,11 @@ nv40_graph_init(struct drm_device *dev)

if (!dev_priv->engine.graph.ctxprog) {
struct nouveau_grctx ctx = {};
uint32_t cp[256];
uint32_t *cp;

cp = kmalloc(sizeof(*cp) * 256, GFP_KERNEL);
if (!cp)
return -ENOMEM;

ctx.dev = dev;
ctx.mode = NOUVEAU_GRCTX_PROG;
Expand All @@ -265,6 +269,8 @@ nv40_graph_init(struct drm_device *dev)
nv_wr32(dev, NV40_PGRAPH_CTXCTL_UCODE_INDEX, 0);
for (i = 0; i < ctx.ctxprog_len; i++)
nv_wr32(dev, NV40_PGRAPH_CTXCTL_UCODE_DATA, cp[i]);

kfree(cp);
}

/* No context present currently */
Expand Down
13 changes: 11 additions & 2 deletions drivers/gpu/drm/radeon/radeon_atombios.c
Original file line number Diff line number Diff line change
Expand Up @@ -680,10 +680,18 @@ bool radeon_get_atom_connector_info_from_supported_devices_table(struct
uint8_t dac;
union atom_supported_devices *supported_devices;
int i, j, max_device;
struct bios_connector bios_connectors[ATOM_MAX_SUPPORTED_DEVICE];
struct bios_connector *bios_connectors;
size_t bc_size = sizeof(*bios_connectors) * ATOM_MAX_SUPPORTED_DEVICE;

if (!atom_parse_data_header(ctx, index, &size, &frev, &crev, &data_offset))
bios_connectors = kzalloc(bc_size, GFP_KERNEL);
if (!bios_connectors)
return false;

if (!atom_parse_data_header(ctx, index, &size, &frev, &crev,
&data_offset)) {
kfree(bios_connectors);
return false;
}

supported_devices =
(union atom_supported_devices *)(ctx->bios + data_offset);
Expand Down Expand Up @@ -851,6 +859,7 @@ bool radeon_get_atom_connector_info_from_supported_devices_table(struct

radeon_link_encoder_connector(dev);

kfree(bios_connectors);
return true;
}

Expand Down

0 comments on commit f49d273

Please sign in to comment.